Address Details
contract
proxy
token
0x8A567e2aE79CA692Bd748aB832081C45de4041eA
- Creator
- 0x56fd3f–9b8d81 at 0xd5a642–bdb417
- Implementation
- StableTokenV2 | 0x434563b0604be100f04b7ae485bcafe3c9d8850e
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 55 Transactions
- Transfers
- 1 Transfers
- Gas Used
- 2,644,891
- Last Balance Update
- 28939300
Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Read Proxy
Write Contract
Write Proxy
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- StableTokenCOPProxy
- Optimization enabled
- true
- Compiler version
- v0.5.17+commit.d19bba13
- Optimization runs
- 10000
- EVM Version
- istanbul
- Verified at
- 2024-11-06T00:54:59.157200Z
lib/mento-core-2.3.1/contracts/legacy/proxies/StableTokenCOPProxy.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; import "../../common/Proxy.sol"; /* solhint-disable-next-line no-empty-blocks */ contract StableTokenCOPProxy is Proxy { }
/Proxy.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.5.17; /* solhint-disable no-inline-assembly, no-complex-fallback, avoid-low-level-calls */ import "openzeppelin-solidity/contracts/utils/Address.sol"; /** * @title A Proxy utilizing the Unstructured Storage pattern. */ contract Proxy { // Used to store the address of the owner. bytes32 private constant OWNER_POSITION = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1); // Used to store the address of the implementation contract. bytes32 private constant IMPLEMENTATION_POSITION = bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1); event OwnerSet(address indexed owner); event ImplementationSet(address indexed implementation); constructor() public { _setOwner(msg.sender); } /** * @notice Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == _getOwner(), "sender was not owner"); _; } /** * @notice Delegates calls to the implementation contract. */ function() external payable { bytes32 implementationPosition = IMPLEMENTATION_POSITION; address implementationAddress; // Load the address of the implementation contract from an explicit storage slot. assembly { implementationAddress := sload(implementationPosition) } // Avoid checking if address is a contract or executing delegated call when // implementation address is 0x0 require(implementationAddress != address(0), "No Implementation set"); require(Address.isContract(implementationAddress), "Invalid contract address"); assembly { // Extract the position of the transaction data (i.e. function ID and arguments). let newCallDataPosition := mload(0x40) mstore(0x40, add(newCallDataPosition, calldatasize)) calldatacopy(newCallDataPosition, 0, calldatasize) // Call the smart contract at `implementationAddress` in the context of the proxy contract, // with the same msg.sender and value. let delegatecallSuccess := delegatecall(gas, implementationAddress, newCallDataPosition, calldatasize, 0, 0) // Copy the return value of the call so it can be returned. let returnDataSize := returndatasize let returnDataPosition := mload(0x40) mstore(0x40, add(returnDataPosition, returnDataSize)) returndatacopy(returnDataPosition, 0, returnDataSize) // Revert or return depending on whether or not the call was successful. switch delegatecallSuccess case 0 { revert(returnDataPosition, returnDataSize) } default { return(returnDataPosition, returnDataSize) } } } /** * @notice Transfers ownership of Proxy to a new owner. * @param newOwner Address of the new owner account. */ function _transferOwnership(address newOwner) external onlyOwner { _setOwner(newOwner); } /** * @notice Sets the address of the implementation contract and calls into it. * @param implementation Address of the new target contract. * @param callbackData The abi-encoded function call to perform in the implementation * contract. * @dev Throws if the initialization callback fails. * @dev If the target contract does not need initialization, use * setImplementation instead. */ function _setAndInitializeImplementation(address implementation, bytes calldata callbackData) external payable onlyOwner { _setImplementation(implementation); bool success; bytes memory returnValue; (success, returnValue) = implementation.delegatecall(callbackData); require(success, "initialization callback failed"); } /** * @notice Returns the implementation address. */ function _getImplementation() external view returns (address implementation) { bytes32 implementationPosition = IMPLEMENTATION_POSITION; // Load the address of the implementation contract from an explicit storage slot. assembly { implementation := sload(implementationPosition) } } /** * @notice Sets the address of the implementation contract. * @param implementation Address of the new target contract. * @dev If the target contract needs to be initialized, call * setAndInitializeImplementation instead. */ function _setImplementation(address implementation) public onlyOwner { bytes32 implementationPosition = IMPLEMENTATION_POSITION; require(Address.isContract(implementation), "Invalid contract address"); // Store the address of the implementation contract in an explicit storage slot. assembly { sstore(implementationPosition, implementation) } emit ImplementationSet(implementation); } /** * @notice Returns the Proxy owner's address. */ function _getOwner() public view returns (address owner) { bytes32 position = OWNER_POSITION; // Load the address of the contract owner from an explicit storage slot. assembly { owner := sload(position) } } function _setOwner(address newOwner) internal { require(newOwner != address(0), "owner cannot be 0"); bytes32 position = OWNER_POSITION; // Store the address of the contract owner in an explicit storage slot. assembly { sstore(position, newOwner) } emit OwnerSet(newOwner); } }
/contracts/utils/Address.sol
pragma solidity ^0.5.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } }
Compiler Settings
{"remappings":[":@chainlink/contracts/=lib/mento-core-2.5.0/lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/",":@openzeppelin/=lib/mento-core-2.5.0/lib/foundry-chainlink-toolkit/lib/openzeppelin-contracts/",":@prb/test/=lib/mento-core-2.5.0/lib/prb-math/lib/prb-test/src/",":celo-foundry/=lib/celo-foundry/src/",":chainlink-brownie-contracts/=lib/mento-core-2.5.0/lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/",":contracts/=contracts/",":ds-test/=lib/celo-foundry/lib/forge-std/lib/ds-test/src/",":forge-std-next/=lib/forge-std-next/src/",":forge-std/=lib/celo-foundry/lib/forge-std/src/",":foundry-chainlink-toolkit/=lib/mento-core-2.5.0/lib/foundry-chainlink-toolkit/",":mento-core-2.0.0/=lib/mento-core-2.0.0/contracts/",":mento-core-2.1.0/=lib/mento-core-2.1.0/contracts/",":mento-core-2.2.0/=lib/mento-core-2.2.0/contracts/",":mento-core-2.3.1/=lib/mento-core-2.3.1/contracts/",":mento-core-2.5.0/=lib/mento-core-2.5.0/contracts/",":openzeppelin-contracts-next/=lib/mento-core-2.3.1/lib/openzeppelin-contracts-next/",":openzeppelin-contracts-upgradeable/=lib/mento-core-2.3.1/lib/openzeppelin-contracts-upgradeable/",":openzeppelin-contracts/=lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/",":openzeppelin-solidity/=lib/mento-core-2.0.0/lib/openzeppelin-contracts/",":prb-math/=lib/mento-core-2.5.0/lib/prb-math/src/",":prb-test/=lib/mento-core-2.5.0/lib/prb-math/lib/prb-test/src/",":prb/math/=lib/mento-core-2.5.0/lib/prb-math/src/",":safe-contracts/=lib/mento-core-2.3.1/lib/safe-contracts/",":src/=lib/mento-core-2.5.0/lib/prb-math/src/",":test/=lib/mento-core-2.0.0/test/"],"optimizer":{"runs":10000,"enabled":true},"libraries":{"AddressSortedLinkedListWithMedian":"0xed477a99035d0c1e11369f1d7a4e587893cc002b","AddressLinkedList":"0x6200f54d73491d56b8d7a975c9ee18efb4d518df"},"evmVersion":"istanbul","compilationTarget":{"lib/mento-core-2.3.1/contracts/legacy/proxies/StableTokenCOPProxy.sol":"StableTokenCOPProxy"}}
Contract ABI
[{"type":"event","name":"ImplementationSet","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnerSet","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true}],"anonymous":false},{"type":"fallback","stateMutability":"payable","payable":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"implementation","internalType":"address"}],"name":"_getImplementation","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"owner","internalType":"address"}],"name":"_getOwner","inputs":[],"constant":true},{"type":"function","stateMutability":"payable","payable":true,"outputs":[],"name":"_setAndInitializeImplementation","inputs":[{"type":"address","name":"implementation","internalType":"address"},{"type":"bytes","name":"callbackData","internalType":"bytes"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"_setImplementation","inputs":[{"type":"address","name":"implementation","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"_transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}],"constant":false}]
Contract Creation Code
0x6080604052610016336001600160e01b0361001b16565b6100d9565b6001600160a01b03811661006a576040805162461bcd60e51b815260206004820152601160248201527006f776e65722063616e6e6f74206265203607c1b604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e61646d696e000000000000000000000000008152905190819003601301812060001901828155906001600160a01b038316907f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe290600090a25050565b61096b806100e86000396000f3fe60806040526004361061005a5760003560e01c8063bb913f4111610043578063bb913f41146102a7578063d29d44ee146102e7578063f7e6af80146103275761005a565b806303386ba3146101da57806342404e0714610269575b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01805473ffffffffffffffffffffffffffffffffffffffff811661013257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20496d706c656d656e746174696f6e207365740000000000000000000000604482015290519081900360640190fd5b61013b8161033c565b6101a657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e8280156101d6578282f35b8282fd5b610267600480360360408110156101f057600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b509092509050610378565b005b34801561027557600080fd5b5061027e61050c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102b357600080fd5b50610267600480360360208110156102ca57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610564565b3480156102f357600080fd5b506102676004803603602081101561030a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610715565b34801561033357600080fd5b5061027e6107c2565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061037057508115155b949350505050565b6103806107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461041957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b61042283610564565b600060608473ffffffffffffffffffffffffffffffffffffffff1684846040518083838082843760405192019450600093509091505080830381855af49150503d806000811461048e576040519150601f19603f3d011682016040523d82523d6000602084013e610493565b606091505b5090925090508161050557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f696e697469616c697a6174696f6e2063616c6c6261636b206661696c65640000604482015290519081900360640190fd5b5050505050565b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b61056c6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461060557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016106628261033c565b6106cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b81815560405173ffffffffffffffffffffffffffffffffffffffff8316907fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1390600090a25050565b61071d6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b6107bf8161081a565b50565b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b73ffffffffffffffffffffffffffffffffffffffff811661089c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6f776e65722063616e6e6f742062652030000000000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130181207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018281559073ffffffffffffffffffffffffffffffffffffffff8316907f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe290600090a2505056fea265627a7a72315820dc51b60538fc7178a44f956730c7fa04180c043ea75d5d8959b952cf8fd1c42f64736f6c63430005110032
Deployed ByteCode
0x60806040526004361061005a5760003560e01c8063bb913f4111610043578063bb913f41146102a7578063d29d44ee146102e7578063f7e6af80146103275761005a565b806303386ba3146101da57806342404e0714610269575b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01805473ffffffffffffffffffffffffffffffffffffffff811661013257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4e6f20496d706c656d656e746174696f6e207365740000000000000000000000604482015290519081900360640190fd5b61013b8161033c565b6101a657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e8280156101d6578282f35b8282fd5b610267600480360360408110156101f057600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b509092509050610378565b005b34801561027557600080fd5b5061027e61050c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102b357600080fd5b50610267600480360360208110156102ca57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610564565b3480156102f357600080fd5b506102676004803603602081101561030a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610715565b34801561033357600080fd5b5061027e6107c2565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061037057508115155b949350505050565b6103806107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461041957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b61042283610564565b600060608473ffffffffffffffffffffffffffffffffffffffff1684846040518083838082843760405192019450600093509091505080830381855af49150503d806000811461048e576040519150601f19603f3d011682016040523d82523d6000602084013e610493565b606091505b5090925090508161050557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f696e697469616c697a6174696f6e2063616c6c6261636b206661696c65640000604482015290519081900360640190fd5b5050505050565b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b61056c6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461060557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016106628261033c565b6106cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420636f6e747261637420616464726573730000000000000000604482015290519081900360640190fd5b81815560405173ffffffffffffffffffffffffffffffffffffffff8316907fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1390600090a25050565b61071d6107c2565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73656e64657220776173206e6f74206f776e6572000000000000000000000000604482015290519081900360640190fd5b6107bf8161081a565b50565b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015490565b73ffffffffffffffffffffffffffffffffffffffff811661089c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6f776e65722063616e6e6f742062652030000000000000000000000000000000604482015290519081900360640190fd5b604080517f656970313936372e70726f78792e61646d696e00000000000000000000000000815290519081900360130181207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018281559073ffffffffffffffffffffffffffffffffffffffff8316907f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe290600090a2505056fea265627a7a72315820dc51b60538fc7178a44f956730c7fa04180c043ea75d5d8959b952cf8fd1c42f64736f6c63430005110032
External libraries
AddressLinkedList : 0x6200f54d73491d56b8d7a975c9ee18efb4d518df
AddressSortedLinkedListWithMedian : 0xed477a99035d0c1e11369f1d7a4e587893cc002b