Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 78 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit | 20350241 | 9 days ago | IN | 0 ETH | 0.00033496 | ||||
Deposit | 20313366 | 14 days ago | IN | 0 ETH | 0.00262596 | ||||
Withdraw | 20280285 | 19 days ago | IN | 0 ETH | 0.00018064 | ||||
Deposit | 20160361 | 36 days ago | IN | 0 ETH | 0.00067037 | ||||
Deposit | 20119237 | 41 days ago | IN | 0 ETH | 0.00222281 | ||||
Withdraw | 20119225 | 41 days ago | IN | 0 ETH | 0.00132194 | ||||
Deposit | 20116291 | 42 days ago | IN | 0 ETH | 0.0007915 | ||||
Withdraw | 19920757 | 69 days ago | IN | 0 ETH | 0.00095116 | ||||
Withdraw | 19823102 | 83 days ago | IN | 0 ETH | 0.00032635 | ||||
Deposit | 19792364 | 87 days ago | IN | 0 ETH | 0.00053741 | ||||
Withdraw | 19694150 | 101 days ago | IN | 0 ETH | 0.00043665 | ||||
Withdraw | 19684721 | 102 days ago | IN | 0 ETH | 0.00053569 | ||||
Deposit | 19644272 | 108 days ago | IN | 0 ETH | 0.00098417 | ||||
Withdraw | 19644263 | 108 days ago | IN | 0 ETH | 0.00103168 | ||||
Deposit | 19640424 | 108 days ago | IN | 0 ETH | 0.00289686 | ||||
Deposit | 19639712 | 108 days ago | IN | 0 ETH | 0.00232256 | ||||
Withdraw | 19624939 | 110 days ago | IN | 0 ETH | 0.00110063 | ||||
Deposit | 19624406 | 111 days ago | IN | 0 ETH | 0.00139462 | ||||
Withdraw | 19610509 | 112 days ago | IN | 0 ETH | 0.00098743 | ||||
Deposit | 19606233 | 113 days ago | IN | 0 ETH | 0.00149712 | ||||
Deposit | 19585017 | 116 days ago | IN | 0 ETH | 0.00238318 | ||||
Deposit | 19532586 | 123 days ago | IN | 0 ETH | 0.00353937 | ||||
Deposit | 19524869 | 125 days ago | IN | 0 ETH | 0.00244975 | ||||
Deposit | 19511099 | 126 days ago | IN | 0 ETH | 0.00250382 | ||||
Withdraw | 19489843 | 129 days ago | IN | 0 ETH | 0.00185933 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20350241 | 9 days ago | 0 ETH | ||||
20313366 | 14 days ago | 0 ETH | ||||
20160361 | 36 days ago | 0 ETH | ||||
20119237 | 41 days ago | 0 ETH | ||||
20116291 | 42 days ago | 0 ETH | ||||
19792364 | 87 days ago | 0 ETH | ||||
19644272 | 108 days ago | 0 ETH | ||||
19640424 | 108 days ago | 0 ETH | ||||
19639712 | 108 days ago | 0 ETH | ||||
19624406 | 111 days ago | 0 ETH | ||||
19606233 | 113 days ago | 0 ETH | ||||
19585017 | 116 days ago | 0 ETH | ||||
19532586 | 123 days ago | 0 ETH | ||||
19524869 | 125 days ago | 0 ETH | ||||
19511099 | 126 days ago | 0 ETH | ||||
19485058 | 130 days ago | 0 ETH | ||||
19472351 | 132 days ago | 0 ETH | ||||
19472266 | 132 days ago | 0 ETH | ||||
19470983 | 132 days ago | 0 ETH | ||||
19468275 | 132 days ago | 0 ETH | ||||
19458591 | 134 days ago | 0 ETH | ||||
19437972 | 137 days ago | 0 ETH | ||||
19435093 | 137 days ago | 0 ETH | ||||
19430412 | 138 days ago | 0 ETH | ||||
19426679 | 138 days ago | 0 ETH |
Loading...
Loading
Contract Name:
StarknetPaperBridge
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20Like { function transfer(address to, uint256 amount) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool success); } interface IStarknetCore { /** Sends a message to an L2 contract. Returns the hash of the message. */ function sendMessageToL2( uint256 toAddress, uint256 selector, uint256[] calldata payload ) external payable returns (bytes32); /** Consumes a message that was sent from an L2 contract. Returns the hash of the message. */ function consumeMessageFromL2( uint256 fromAddress, uint256[] calldata payload ) external returns (bytes32); } contract StarknetPaperBridge { /// @notice The Starknet Core contract address on L1 address public immutable starknet; /// @notice The $PAPER ERC20 contract address on L1 address public immutable l1Token; /// @notice The L2 address of the $PAPER bridge, the counterpart to this contract uint256 public immutable l2Bridge; event LogDeposit( address indexed l1Sender, uint256 amount, uint256 l2Recipient ); event LogWithdrawal(address indexed l1Recipient, uint256 amount, uint256 l2TxHash); // 2 ** 251 + 17 * 2 ** 192 + 1; uint256 private constant CAIRO_PRIME = 3618502788666131213697322783095070105623107215331596699973092056135872020481; // from starkware.starknet.compiler.compile import get_selector_from_name // print(get_selector_from_name('handle_deposit')) uint256 private constant DEPOSIT_SELECTOR = 1285101517810983806491589552491143496277809242732141897358598292095611420389; // operation ID sent in the L2 -> L1 message uint256 private constant PROCESS_WITHDRAWAL = 1; function splitUint256( uint256 value ) internal pure returns (uint256, uint256) { uint256 low = value & ((1 << 128) - 1); uint256 high = value >> 128; return (low, high); } constructor(address _starknet, address _l1Token, uint256 _l2Bridge) { require(_l2Bridge < CAIRO_PRIME, "Invalid L2 bridge address"); starknet = _starknet; l1Token = _l1Token; l2Bridge = _l2Bridge; } /// @notice Function used to bridge $PAPER from L1 to L2 /// @param amount How many $PAPER to send from msg.sender /// @param l2Recipient To which L2 address should we deposit the $PAPER to /// @param fee Compulsory fee paid to the sequencer for passing on the message function deposit( uint256 amount, uint256 l2Recipient, uint256 fee ) external payable { require(amount > 0, "Amount is 0"); require( l2Recipient != 0 && l2Recipient != l2Bridge && l2Recipient < CAIRO_PRIME, "Invalid L2 recipient" ); uint256[] memory payload = new uint256[](3); payload[0] = l2Recipient; (payload[1], payload[2]) = splitUint256(amount); IERC20Like(l1Token).transferFrom(msg.sender, address(this), amount); IStarknetCore(starknet).sendMessageToL2{value: fee}( l2Bridge, DEPOSIT_SELECTOR, payload ); emit LogDeposit(msg.sender, amount, l2Recipient); } /// @notice Function to process the L2 withdrawal /// @param amount How many $PAPER were sent from L2 /// @param l1Recipient Recipient of the (de)bridged $PAPER /// @param l2TxHash l2 tx_hash for matching txs in ui function withdraw(uint256 amount, address l1Recipient, uint256 l2TxHash) external { uint256[] memory payload = new uint256[](4); payload[0] = PROCESS_WITHDRAWAL; payload[1] = uint256(uint160(l1Recipient)); (payload[2], payload[3]) = splitUint256(amount); // The call to consumeMessageFromL2 will succeed only if a // matching L2->L1 message exists and is ready for consumption. IStarknetCore(starknet).consumeMessageFromL2(l2Bridge, payload); IERC20Like(l1Token).transfer(l1Recipient, amount); emit LogWithdrawal(l1Recipient, amount, l2TxHash); } }
{ "remappings": [ "@forge-std/=lib/forge-std/src/", "@create3-factory/=lib/create3-factory/src/", "@openzeppelin/=lib/@openzeppelin/", "@starknet/=lib/starknet/", "create3-factory/=lib/create3-factory/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/create3-factory/lib/solmate/src/", "starknet/=lib/starknet/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_starknet","type":"address"},{"internalType":"address","name":"_l1Token","type":"address"},{"internalType":"uint256","name":"_l2Bridge","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"l1Sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"l2Recipient","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"l1Recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"l2TxHash","type":"uint256"}],"name":"LogWithdrawal","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"l1Token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2Bridge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"starknet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"l1Recipient","type":"address"},{"internalType":"uint256","name":"l2TxHash","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e060405234801561001057600080fd5b5060405161098738038061098783398101604081905261002f916100d9565b7f080000000000001100000000000000000000000000000000000000000000000181106100a25760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964204c3220627269646765206164647265737300000000000000604482015260640160405180910390fd5b6001600160a01b03928316608052911660a05260c052610115565b80516001600160a01b03811681146100d457600080fd5b919050565b6000806000606084860312156100ee57600080fd5b6100f7846100bd565b9250610105602085016100bd565b9150604084015190509250925092565b60805160a05160c0516108146101736000396000818160750152818161019901528181610383015261054f015260008181610108015281816102c701526105e301526000818160bc01528181610354015261052201526108146000f3fe6080604052600436106100495760003560e01c8062aeef8a1461004e578063ae1f6aaf14610063578063bb903eea146100aa578063c01e1bd6146100f6578063e63697c81461012a575b600080fd5b61006161005c366004610692565b61014a565b005b34801561006f57600080fd5b506100977f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b3480156100b657600080fd5b506100de7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a1565b34801561010257600080fd5b506100de7f000000000000000000000000000000000000000000000000000000000000000081565b34801561013657600080fd5b506100616101453660046106be565b610455565b6000831161018d5760405162461bcd60e51b815260206004820152600b60248201526a0416d6f756e7420697320360ac1b60448201526064015b60405180910390fd5b81158015906101bc57507f00000000000000000000000000000000000000000000000000000000000000008214155b80156101d55750600167080000000000001160c01b0182105b6102185760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a5908130c881c9958da5c1a595b9d60621b6044820152606401610184565b6040805160038082526080820190925260009160208201606080368337019050509050828160008151811061024f5761024f610702565b60209081029190910101526001600160801b038416608085901c8260018151811061027c5761027c610702565b602002602001018360028151811061029657610296610702565b6020908102919091010191909152526040516323b872dd60e01b8152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033c9190610718565b50604051633e3aa6c560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633e3aa6c59084906103cf907f0000000000000000000000000000000000000000000000000000000000000000907f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee590879060040161077c565b60206040518083038185885af11580156103ed573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061041291906107a4565b50604080518581526020810185905233917f9dbb0e7dda3e09710ce75b801addc87cf9d9c6c581641b3275fca409ad086c6291015b60405180910390a250505050565b60408051600480825260a082019092526000916020820160808036833701905050905060018160008151811061048d5761048d610702565b602002602001018181525050826001600160a01b0316816001815181106104b6576104b6610702565b60209081029190910101526001600160801b038416608085901c826002815181106104e3576104e3610702565b60200260200101836003815181106104fd576104fd610702565b60209081029190910101919091525260405162b2775760e61b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632c9dd5c090610579907f00000000000000000000000000000000000000000000000000000000000000009085906004016107bd565b6020604051808303816000875af1158015610598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bc91906107a4565b5060405163a9059cbb60e01b81526001600160a01b038481166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561062c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106509190610718565b5060408051858152602081018490526001600160a01b038516917ff9226daf630542048a23086c6af599511aac100ec8f532793cc9697d061bed7e9101610447565b6000806000606084860312156106a757600080fd5b505081359360208301359350604090920135919050565b6000806000606084860312156106d357600080fd5b8335925060208401356001600160a01b03811681146106f157600080fd5b929592945050506040919091013590565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561072a57600080fd5b8151801515811461073a57600080fd5b9392505050565b600081518084526020808501945080840160005b8381101561077157815187529582019590820190600101610755565b509495945050505050565b83815282602082015260606040820152600061079b6060830184610741565b95945050505050565b6000602082840312156107b657600080fd5b5051919050565b8281526040602082015260006107d66040830184610741565b94935050505056fea264697066735822122082c1930bf786041dd091631886c128093c25b0d9dd60e4cdfd949d073f8b4a2a64736f6c634300080d0033000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c40000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c64
Deployed Bytecode
0x6080604052600436106100495760003560e01c8062aeef8a1461004e578063ae1f6aaf14610063578063bb903eea146100aa578063c01e1bd6146100f6578063e63697c81461012a575b600080fd5b61006161005c366004610692565b61014a565b005b34801561006f57600080fd5b506100977f019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c6481565b6040519081526020015b60405180910390f35b3480156100b657600080fd5b506100de7f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c481565b6040516001600160a01b0390911681526020016100a1565b34801561010257600080fd5b506100de7f0000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c81565b34801561013657600080fd5b506100616101453660046106be565b610455565b6000831161018d5760405162461bcd60e51b815260206004820152600b60248201526a0416d6f756e7420697320360ac1b60448201526064015b60405180910390fd5b81158015906101bc57507f019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c648214155b80156101d55750600167080000000000001160c01b0182105b6102185760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a5908130c881c9958da5c1a595b9d60621b6044820152606401610184565b6040805160038082526080820190925260009160208201606080368337019050509050828160008151811061024f5761024f610702565b60209081029190910101526001600160801b038416608085901c8260018151811061027c5761027c610702565b602002602001018360028151811061029657610296610702565b6020908102919091010191909152526040516323b872dd60e01b8152336004820152306024820152604481018590527f0000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033c9190610718565b50604051633e3aa6c560e01b81526001600160a01b037f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c41690633e3aa6c59084906103cf907f019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c64907f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee590879060040161077c565b60206040518083038185885af11580156103ed573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061041291906107a4565b50604080518581526020810185905233917f9dbb0e7dda3e09710ce75b801addc87cf9d9c6c581641b3275fca409ad086c6291015b60405180910390a250505050565b60408051600480825260a082019092526000916020820160808036833701905050905060018160008151811061048d5761048d610702565b602002602001018181525050826001600160a01b0316816001815181106104b6576104b6610702565b60209081029190910101526001600160801b038416608085901c826002815181106104e3576104e3610702565b60200260200101836003815181106104fd576104fd610702565b60209081029190910101919091525260405162b2775760e61b81526001600160a01b037f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c41690632c9dd5c090610579907f019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c649085906004016107bd565b6020604051808303816000875af1158015610598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bc91906107a4565b5060405163a9059cbb60e01b81526001600160a01b038481166004830152602482018690527f0000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c169063a9059cbb906044016020604051808303816000875af115801561062c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106509190610718565b5060408051858152602081018490526001600160a01b038516917ff9226daf630542048a23086c6af599511aac100ec8f532793cc9697d061bed7e9101610447565b6000806000606084860312156106a757600080fd5b505081359360208301359350604090920135919050565b6000806000606084860312156106d357600080fd5b8335925060208401356001600160a01b03811681146106f157600080fd5b929592945050506040919091013590565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561072a57600080fd5b8151801515811461073a57600080fd5b9392505050565b600081518084526020808501945080840160005b8381101561077157815187529582019590820190600101610755565b509495945050505050565b83815282602082015260606040820152600061079b6060830184610741565b95945050505050565b6000602082840312156107b657600080fd5b5051919050565b8281526040602082015260006107d66040830184610741565b94935050505056fea264697066735822122082c1930bf786041dd091631886c128093c25b0d9dd60e4cdfd949d073f8b4a2a64736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c40000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c64
-----Decoded View---------------
Arg [0] : _starknet (address): 0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4
Arg [1] : _l1Token (address): 0x7aE1D57b58fA6411F32948314BadD83583eE0e8C
Arg [2] : _l2Bridge (uint256): 727514425430785187573925570911676231942205654723091698352464647861569490020
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4
Arg [1] : 0000000000000000000000007ae1d57b58fa6411f32948314badd83583ee0e8c
Arg [2] : 019bc231d0b20ea77e02cf286c93320df980bab5818bd13386c84998cb3e8c64
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.00337 | 80,401,444.5657 | $270,948.04 |
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.