Contract
0xd78b6bD09cd28A83cFb21aFa0DA95c685A6bb0B1
1
Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
L2LPTDataCache
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {IArbSys} from "../../arbitrum/IArbSys.sol"; abstract contract L2ArbitrumMessenger { event TxToL1( address indexed _from, address indexed _to, uint256 indexed _id, bytes _data ); function sendTxToL1( address user, address to, bytes memory data ) internal returns (uint256) { // note: this method doesn't support sending ether to L1 together with a call uint256 id = IArbSys(address(100)).sendTxToL1(to, data); emit TxToL1(user, to, id, data); return id; } modifier onlyL1Counterpart(address l1Counterpart) { require( msg.sender == applyL1ToL2Alias(l1Counterpart), "ONLY_COUNTERPART_GATEWAY" ); _; } uint160 internal constant OFFSET = uint160(0x1111000000000000000000000000000000001111); // l1 addresses are transformed durng l1->l2 calls function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { l2Address = address(uint160(l1Address) + OFFSET); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {L2ArbitrumMessenger} from "./L2ArbitrumMessenger.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract L2LPTDataCache is Ownable, L2ArbitrumMessenger { address public l1LPTDataCache; address public l2LPTGateway; // Total supply of LPT on L1 // Updates are initiated by a call from the L1LPTDataCache on L1 uint256 public l1TotalSupply; // Amount of L2 LPT transferred from L1 via the LPT bridge uint256 public l2SupplyFromL1; event CacheTotalSupplyFinalized(uint256 totalSupply); event L1LPTDataCacheUpdate(address _l1LPTDataCache); event L2LPTGatewayUpdate(address _l2LPTGateway); modifier onlyL2LPTGateway() { require(msg.sender == l2LPTGateway, "NOT_L2_LPT_GATEWAY"); _; } /** * @notice Sets the L1LPTDataCache * @param _l1LPTDataCache L1 address of L1LPTDataCache */ function setL1LPTDataCache(address _l1LPTDataCache) external onlyOwner { l1LPTDataCache = _l1LPTDataCache; emit L1LPTDataCacheUpdate(_l1LPTDataCache); } /** * @notice Sets the L2LPTGateway * @param _l2LPTGateway L2 address of L2LPTGateway */ function setL2LPTGateway(address _l2LPTGateway) external onlyOwner { l2LPTGateway = _l2LPTGateway; emit L2LPTGatewayUpdate(_l2LPTGateway); } /** * @notice Called by L2LPTGateway to increase l2SupplyFromL1 * @dev Should be called when L2LPTGateway mints LPT to ensure that L2 total supply and l2SupplyFromL1 increase by the same amount * @param _amount Amount to increase l2SupplyFromL1 */ function increaseL2SupplyFromL1(uint256 _amount) external onlyL2LPTGateway { l2SupplyFromL1 += _amount; // No event because the L2LPTGateway events are sufficient } /** * @notice Called by L2LPTGateway to decrease l2SupplyFromL1 * @dev Should be called when L2LPTGateway burns LPT ensure L2 total supply and l2SupplyFromL1 decrease by the same amount * @param _amount Amount to decrease l2SupplyFromL1 */ function decreaseL2SupplyFromL1(uint256 _amount) external onlyL2LPTGateway { // If there is a mass withdrawal from L2, _amount could exceed l2SupplyFromL1. // In this case, we just set l2SupplyFromL1 = 0 because there will be no more supply on L2 // that is from L1 and the excess (_amount - l2SupplyFromL1) is inflationary LPT that was // never from L1 in the first place. uint256 ml2SupplyFromL1 = l2SupplyFromL1; if (_amount >= ml2SupplyFromL1) { l2SupplyFromL1 = 0; } else { // Underflow not possible due to preceeding check unchecked { l2SupplyFromL1 = ml2SupplyFromL1 - _amount; } } // No event because the L2LPTGateway events are sufficient } /** * @notice Called by L1LPTDataCache from L1 to cache L1 LPT total supply * @param _totalSupply L1 LPT total supply */ function finalizeCacheTotalSupply(uint256 _totalSupply) external onlyL1Counterpart(l1LPTDataCache) { l1TotalSupply = _totalSupply; emit CacheTotalSupplyFinalized(_totalSupply); } /** * @notice Calculate and return L1 LPT circulating supply * @return L1 LPT circulating supply */ function l1CirculatingSupply() public view returns (uint256) { // After the first update from L1, l1TotalSupply should always be >= l2SupplyFromL1 // The below check is defensive to avoid reverting if this invariant for some reason violated uint256 ml1TotalSupply = l1TotalSupply; uint256 ml2SupplyFromL1 = l2SupplyFromL1; if (ml1TotalSupply > ml2SupplyFromL1) { // Underflow not possible due to prceeding check unchecked { return ml1TotalSupply - ml2SupplyFromL1; } } else { return 0; } } }
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2021, Offchain Labs, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ pragma solidity 0.8.9; /** * @title Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality. */ interface IArbSys { /** * @notice Get internal version number identifying an ArbOS build * @return version number as int */ function arbOSVersion() external pure returns (uint256); function arbChainID() external view returns (uint256); /** * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0) * @return block number as int */ function arbBlockNumber() external view returns (uint256); /** * @notice Send given amount of Eth to dest from sender. * This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1. * @param destination recipient address on L1 * @return unique identifier for this L2-to-L1 transaction. */ function withdrawEth(address destination) external payable returns (uint256); /** * @notice Send a transaction to L1 * @param destination recipient address on L1 * @param calldataForL1 (optional) calldata for L1 contract call * @return a unique identifier for this L2-to-L1 transaction. */ function sendTxToL1(address destination, bytes calldata calldataForL1) external payable returns (uint256); /** * @notice get the number of transactions issued by the given external account or the account sequence number of the given contract * @param account target account * @return the number of transactions issued by the given external account or the account sequence number of the given contract */ function getTransactionCount(address account) external view returns (uint256); /** * @notice get the value of target L2 storage slot * This function is only callable from address 0 to prevent contracts from being able to call it * @param account target account * @param index target index of storage slot * @return stotage value for the given account at the given index */ function getStorageAt(address account, uint256 index) external view returns (uint256); /** * @notice check if current call is coming from l1 * @return true if the caller of this was called directly from L1 */ function isTopLevelCall() external view returns (bool); event EthWithdrawal(address indexed destAddr, uint256 amount); event L2ToL1Transaction( address caller, address indexed destination, uint256 indexed uniqueId, uint256 indexed batchNumber, uint256 indexInBatch, uint256 arbBlockNum, uint256 ethBlockNum, uint256 timestamp, uint256 callvalue, bytes data ); }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": false, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"}],"name":"CacheTotalSupplyFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_l1LPTDataCache","type":"address"}],"name":"L1LPTDataCacheUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_l2LPTGateway","type":"address"}],"name":"L2LPTGatewayUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"TxToL1","type":"event"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"decreaseL2SupplyFromL1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"name":"finalizeCacheTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseL2SupplyFromL1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"l1CirculatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l1LPTDataCache","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l1TotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2LPTGateway","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2SupplyFromL1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l1LPTDataCache","type":"address"}],"name":"setL1LPTDataCache","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l2LPTGateway","type":"address"}],"name":"setL2LPTGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b610dbe8061010d6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063b833138511610066578063b8331385146101c6578063e879a2aa146101e4578063f2fde38b14610200578063fb1c5ee91461021c576100cf565b80638da5cb5b14610170578063a6402a7f1461018e578063ae3a23e0146101aa576100cf565b8063095654b6146100d45780630dd264d5146100f05780631429ce661461010e5780632b8242731461012a578063715018a6146101485780638869bdb914610152575b600080fd5b6100ee60048036038101906100e991906109ee565b61023a565b005b6100f8610331565b6040516101059190610a2a565b60405180910390f35b610128600480360381019061012391906109ee565b610357565b005b61013261044e565b60405161013f9190610a5e565b60405180910390f35b610150610454565b005b61015a6104dc565b6040516101679190610a2a565b60405180910390f35b610178610502565b6040516101859190610a2a565b60405180910390f35b6101a860048036038101906101a39190610aa5565b61052b565b005b6101c460048036038101906101bf9190610aa5565b6105e4565b005b6101ce6106bf565b6040516101db9190610a5e565b60405180910390f35b6101fe60048036038101906101f99190610aa5565b6106c5565b005b61021a600480360381019061021591906109ee565b610771565b005b610224610869565b6040516102319190610a5e565b60405180910390f35b610242610896565b73ffffffffffffffffffffffffffffffffffffffff16610260610502565b73ffffffffffffffffffffffffffffffffffffffff16146102b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ad90610b2f565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f9cf6eb430e92164d095d7b192a8fb7ee335cba2af93fdc0edbef89f143e6d99c816040516103269190610a2a565b60405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61035f610896565b73ffffffffffffffffffffffffffffffffffffffff1661037d610502565b73ffffffffffffffffffffffffffffffffffffffff16146103d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ca90610b2f565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fda145949d59bdc825dbdf7ef8e4320bf85cfde45bbc1db19a5399b03849b2e29816040516104439190610a2a565b60405180910390a150565b60045481565b61045c610896565b73ffffffffffffffffffffffffffffffffffffffff1661047a610502565b73ffffffffffffffffffffffffffffffffffffffff16146104d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c790610b2f565b60405180910390fd5b6104da600061089e565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b290610b9b565b60405180910390fd5b600060045490508082106105d65760006004819055506105e0565b8181036004819055505b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061081610962565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067490610c07565b60405180910390fd5b816003819055507f8d07aadbdca8bc9f3ec4711bd6c9f59cb3b4201d014664d6ebdfb201e751d308826040516106b39190610a5e565b60405180910390a15050565b60035481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610755576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074c90610b9b565b60405180910390fd5b80600460008282546107679190610c56565b9250508190555050565b610779610896565b73ffffffffffffffffffffffffffffffffffffffff16610797610502565b73ffffffffffffffffffffffffffffffffffffffff16146107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e490610b2f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561085d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085490610d1e565b60405180910390fd5b6108668161089e565b50565b6000806003549050600060045490508082111561088c5780820392505050610893565b6000925050505b90565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000731111000000000000000000000000000000001111826109849190610d3e565b9050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006109bb82610990565b9050919050565b6109cb816109b0565b81146109d657600080fd5b50565b6000813590506109e8816109c2565b92915050565b600060208284031215610a0457610a0361098b565b5b6000610a12848285016109d9565b91505092915050565b610a24816109b0565b82525050565b6000602082019050610a3f6000830184610a1b565b92915050565b6000819050919050565b610a5881610a45565b82525050565b6000602082019050610a736000830184610a4f565b92915050565b610a8281610a45565b8114610a8d57600080fd5b50565b600081359050610a9f81610a79565b92915050565b600060208284031215610abb57610aba61098b565b5b6000610ac984828501610a90565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610b19602083610ad2565b9150610b2482610ae3565b602082019050919050565b60006020820190508181036000830152610b4881610b0c565b9050919050565b7f4e4f545f4c325f4c50545f474154455741590000000000000000000000000000600082015250565b6000610b85601283610ad2565b9150610b9082610b4f565b602082019050919050565b60006020820190508181036000830152610bb481610b78565b9050919050565b7f4f4e4c595f434f554e544552504152545f474154455741590000000000000000600082015250565b6000610bf1601883610ad2565b9150610bfc82610bbb565b602082019050919050565b60006020820190508181036000830152610c2081610be4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610c6182610a45565b9150610c6c83610a45565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ca157610ca0610c27565b5b828201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610d08602683610ad2565b9150610d1382610cac565b604082019050919050565b60006020820190508181036000830152610d3781610cfb565b9050919050565b6000610d4982610990565b9150610d5483610990565b92508273ffffffffffffffffffffffffffffffffffffffff03821115610d7d57610d7c610c27565b5b82820190509291505056fea2646970667358221220acd73dcb2cfbfe2cfa7e67fe9a1340b5dcd420289ce967c1881313ce9884890f64736f6c63430008090033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.