Source Code
Latest 9 from a total of 9 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Execute | 22451408 | 7 days ago | IN | 0 ETH | 0.00025411 | ||||
Execute | 22009526 | 69 days ago | IN | 0 ETH | 0.00005395 | ||||
Execute | 22009522 | 69 days ago | IN | 0 ETH | 0.00004812 | ||||
Execute | 22009410 | 69 days ago | IN | 0 ETH | 0.00004652 | ||||
Execute | 22009408 | 69 days ago | IN | 0 ETH | 0.00003299 | ||||
Execute | 22009403 | 69 days ago | IN | 0 ETH | 0.00004286 | ||||
Execute | 21940796 | 79 days ago | IN | 0 ETH | 0.0000501 | ||||
Transfer | 21759168 | 104 days ago | IN | 0.132 ETH | 0.00008319 | ||||
Execute | 21717560 | 110 days ago | IN | 0 ETH | 0.00088605 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StarknetOwnerProxy
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 9999999 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.28; interface IStarknetMessaging { function consumeMessageFromL2(uint256 fromAddress, uint256[] calldata payload) external returns (bytes32); } contract StarknetOwnerProxy { error InvalidTarget(); error InsufficientBalance(); error InvalidNonce(uint64 current, uint64 nonce); error CallFailed(bytes data); IStarknetMessaging public immutable l2MessageBridge; uint256 public immutable l2Owner; uint64 public currentNonce; constructor(IStarknetMessaging _l2MessageBridge, uint256 _l2Owner) { l2MessageBridge = _l2MessageBridge; l2Owner = _l2Owner; } // Returns the payload split into 31-byte chunks, // ensuring each element is < 2^251 function getPayload(address target, uint256 value, uint64 nonce, bytes calldata data) public pure returns (uint256[] memory) { // Each payload element can hold up to 31 bytes since it has to be expressed as felt252 on Starknet uint256 chunkCount = (data.length + 30) / 31; uint256[] memory payload = new uint256[](4 + chunkCount); payload[0] = uint256(uint160(target)); payload[1] = value; payload[2] = nonce; payload[3] = data.length; for (uint256 i = 0; i < chunkCount; i++) { assembly ("memory-safe") { mstore(add(payload, mul(add(i, 5), 32)), shr(8, calldataload(add(data.offset, mul(i, 31))))) } } return payload; } function execute(address target, uint256 value, uint64 nonce, bytes calldata data) external returns (bytes memory) { if (target == address(0) || target == address(this)) { revert InvalidTarget(); } if (address(this).balance < value) revert InsufficientBalance(); if (currentNonce != nonce) revert InvalidNonce(currentNonce, nonce); currentNonce++; // Consume message from L2. This will fail if the message has not been sent from L2. l2MessageBridge.consumeMessageFromL2(l2Owner, getPayload(target, value, nonce, data)); (bool success, bytes memory result) = target.call{value: value}(data); if (!success) revert CallFailed(result); return result; } // Allow contract to receive ETH receive() external payable {} }
{ "remappings": [ "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 9999999 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IStarknetMessaging","name":"_l2MessageBridge","type":"address"},{"internalType":"uint256","name":"_l2Owner","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint64","name":"current","type":"uint64"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"InvalidNonce","type":"error"},{"inputs":[],"name":"InvalidTarget","type":"error"},{"inputs":[],"name":"currentNonce","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"getPayload","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"l2MessageBridge","outputs":[{"internalType":"contract IStarknetMessaging","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2Owner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c03461008957601f61085338819003918201601f19168301916001600160401b0383118484101761008d578084926040948552833981010312610089578051906001600160a01b038216820361008957602001519060805260a0526040516107b190816100a2823960805181818161013f0152610293015260a051818181608a01526102440152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806329caec63146104b15780637bedc059146101635780637fab394d146100f5578063adb610a3146100b15763f003a0c50361000e57346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b5f80fd5b346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad57602067ffffffffffffffff5f5416604051908152f35b346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100ad57610171366104e2565b929173ffffffffffffffffffffffffffffffffffffffff851680159081156104a7575b5061047f57824710610457575f549067ffffffffffffffff82169067ffffffffffffffff8116808303610428575067ffffffffffffffff82146103fb57858461021892610279957fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000067ffffffffffffffff600160209801169116175f55878a61065e565b604051809381927f2c9dd5c00000000000000000000000000000000000000000000000000000000083527f0000000000000000000000000000000000000000000000000000000000000000600484015260406024840152604483019061058a565b03815f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af180156103f0576103b8575b50915f93918493826040519384928337810185815203925af13d156103b0573d9067ffffffffffffffff8211610383576040519161032660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610605565b82523d5f602084013e5b156103495761034590604051918291826105bd565b0390f35b61037f906040519182917fa5fa8d2b000000000000000000000000000000000000000000000000000000008352600483016105bd565b0390fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b606090610330565b929093916020843d6020116103e8575b816103d560209383610605565b810103126100ad5791939092505f6102c0565b3d91506103c8565b6040513d5f823e3d90fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b827ff917ffea000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7ff4d678b8000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f82d5d76a000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050301486610194565b346100ad576103456104ce6104c5366104e2565b9392909261065e565b60405191829160208352602083019061058a565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126100ad5760043573ffffffffffffffffffffffffffffffffffffffff811681036100ad57916024359160443567ffffffffffffffff811681036100ad579160643567ffffffffffffffff81116100ad57826023820112156100ad5780600401359267ffffffffffffffff84116100ad57602484830101116100ad576024019190565b90602080835192838152019201905f5b8181106105a75750505090565b825184526020938401939092019160010161059a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602060409481855280519182918282880152018686015e5f8582860101520116010190565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761038357604052565b67ffffffffffffffff81116103835760051b60200190565b93909291601e82018083116103fb57601f9004938460040195866004116103fb576106a161068b88610646565b97610699604051998a610605565b808952610646565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208901920136833787511561074e5773ffffffffffffffffffffffffffffffffffffffff16905285516001101561074e57604086015284516002101561074e5767ffffffffffffffff16606085015283516003101561074e5760808401525f5b8281106107315750505090565b80601f6001920283013560081c6005820160051b86015201610724565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea2646970667358221220defb0df52f98d80f00e83e24c1bce2f7727e3f4625712f7d1119014e499fda1664736f6c634300081c0033000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd
Deployed Bytecode
0x6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806329caec63146104b15780637bedc059146101635780637fab394d146100f5578063adb610a3146100b15763f003a0c50361000e57346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad5760206040517f053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd8152f35b5f80fd5b346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad57602067ffffffffffffffff5f5416604051908152f35b346100ad575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ad57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4168152f35b346100ad57610171366104e2565b929173ffffffffffffffffffffffffffffffffffffffff851680159081156104a7575b5061047f57824710610457575f549067ffffffffffffffff82169067ffffffffffffffff8116808303610428575067ffffffffffffffff82146103fb57858461021892610279957fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000067ffffffffffffffff600160209801169116175f55878a61065e565b604051809381927f2c9dd5c00000000000000000000000000000000000000000000000000000000083527f053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd600484015260406024840152604483019061058a565b03815f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4165af180156103f0576103b8575b50915f93918493826040519384928337810185815203925af13d156103b0573d9067ffffffffffffffff8211610383576040519161032660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610605565b82523d5f602084013e5b156103495761034590604051918291826105bd565b0390f35b61037f906040519182917fa5fa8d2b000000000000000000000000000000000000000000000000000000008352600483016105bd565b0390fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b606090610330565b929093916020843d6020116103e8575b816103d560209383610605565b810103126100ad5791939092505f6102c0565b3d91506103c8565b6040513d5f823e3d90fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b827ff917ffea000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7ff4d678b8000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f82d5d76a000000000000000000000000000000000000000000000000000000005f5260045ffd5b9050301486610194565b346100ad576103456104ce6104c5366104e2565b9392909261065e565b60405191829160208352602083019061058a565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126100ad5760043573ffffffffffffffffffffffffffffffffffffffff811681036100ad57916024359160443567ffffffffffffffff811681036100ad579160643567ffffffffffffffff81116100ad57826023820112156100ad5780600401359267ffffffffffffffff84116100ad57602484830101116100ad576024019190565b90602080835192838152019201905f5b8181106105a75750505090565b825184526020938401939092019160010161059a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602060409481855280519182918282880152018686015e5f8582860101520116010190565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761038357604052565b67ffffffffffffffff81116103835760051b60200190565b93909291601e82018083116103fb57601f9004938460040195866004116103fb576106a161068b88610646565b97610699604051998a610605565b808952610646565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe060208901920136833787511561074e5773ffffffffffffffffffffffffffffffffffffffff16905285516001101561074e57604086015284516002101561074e5767ffffffffffffffff16606085015283516003101561074e5760808401525f5b8281106107315750505090565b80601f6001920283013560081c6005820160051b86015201610724565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea2646970667358221220defb0df52f98d80f00e83e24c1bce2f7727e3f4625712f7d1119014e499fda1664736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd
-----Decoded View---------------
Arg [0] : _l2MessageBridge (address): 0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4
Arg [1] : _l2Owner (uint256): 2354502934501836923955011505963489193673442986857363336683304411560511969997
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4
Arg [1] : 053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.