Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
remove CairoMessaging contract
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Jun 12, 2024
1 parent 3be914f commit 83ef0f7
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 181 deletions.
1 change: 0 additions & 1 deletion cairo1_contracts/cairo_messaging/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion cairo1_contracts/cairo_messaging/.tool-versions

This file was deleted.

6 changes: 0 additions & 6 deletions cairo1_contracts/cairo_messaging/Scarb.lock

This file was deleted.

13 changes: 0 additions & 13 deletions cairo1_contracts/cairo_messaging/Scarb.toml

This file was deleted.

129 changes: 0 additions & 129 deletions cairo1_contracts/cairo_messaging/src/cairo_messaging.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo1_contracts/cairo_messaging/src/lib.cairo

This file was deleted.

1 change: 0 additions & 1 deletion kakarot_scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ class ArtifactType(Enum):
{"contract_name": "replace_class", "cairo_version": ArtifactType.cairo0},
{"contract_name": "Counter", "cairo_version": ArtifactType.cairo0},
{"contract_name": "MockPragmaOracle", "cairo_version": ArtifactType.cairo1},
{"contract_name": "CairoMessaging", "cairo_version": ArtifactType.cairo1},
]

EVM_PRIVATE_KEY = os.getenv("EVM_PRIVATE_KEY")
Expand Down
1 change: 0 additions & 1 deletion kakarot_scripts/deploy_kakarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ async def main():
)
deployments["Counter"] = await deploy("Counter")
deployments["MockPragmaOracle"] = await deploy("MockPragmaOracle")
deployments["CairoMessaging"] = await deploy("CairoMessaging")

dump_deployments(deployments)

Expand Down
20 changes: 1 addition & 19 deletions solidity_contracts/src/L1L2Messaging/MessageSenderL2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,10 @@ pragma solidity >=0.7.0 <0.9.0;

import "../CairoPrecompiles/CairoLib.sol";

using CairoLib for uint256;

contract MessageSenderL2 {
/// @dev The starknet address of the Kakarot L2 Messaging contract
uint256 messagingContract;

/// @dev The cairo function selector to call
uint256 constant SEND_MESSAGE_VALUE = uint256(keccak256("send_message_value")) % 2**250;

constructor(uint256 messagingContractAddress) {
messagingContract = messagingContractAddress;
}

// @notice Sends a message to L1.
// @dev Uses the Cairo Precompiles mechanism to invoke a Cairo contract that uses the Starknet
// messaging system.
// @dev Uses the Cairo Precompiles mechanism to invoke a the send_message_to_l1 syscall
function sendMessageToL1(address to, uint128 value) external {
// uint256[] memory data = new uint256[](2);
// data[0] = uint256(uint160(to));
// data[1] = uint256(value);
// messagingContract.callContract(SEND_MESSAGE_VALUE, data);

uint248[] memory data = new uint248[](1);
data[0] = uint248(value);
CairoLib.sendMessageToL1(to, data);
Expand Down
9 changes: 0 additions & 9 deletions tests/end_to_end/L1L2Messaging/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,11 @@ async def sn_messaging_local(deploy_l1_contract, owner):

@pytest.fixture(scope="session")
async def message_sender_l2(deploy_contract, owner):
cairo_messaging_address = get_deployments()["CairoMessaging"]["address"]
message_sender = await deploy_contract(
"L1L2Messaging",
"MessageSenderL2",
cairo_messaging_address,
caller_eoa=owner.starknet_contract,
)

# await invoke(
# "kakarot",
# "set_authorized_cairo_precompile_caller",
# int(message_sender.address, 16),
# True,
# )
return message_sender


Expand Down

0 comments on commit 83ef0f7

Please sign in to comment.