Address Contract Verified
Address
0xc1ca42De59B86C4b8e574beCd693565AaC467AA7
Balance
0 ETH
Nonce
1
Code Size
9811 bytes
Creator
0x5eF90585...897E at tx 0x0c62c0e6...bba633
Indexed Transactions
0
Contract Bytecode
9811 bytes
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806376b467b7116100de578063b8cc275111610097578063dc55578911610071578063dc55578914610486578063dd62ed3e146104b6578063f2fde38b146104e6578063f435f5a71461050257610173565b8063b8cc2751146103f6578063cbf9fe5f14610426578063cca3e8321461045657610173565b806376b467b7146102fa5780638da5cb5b1461032a57806395d89b4114610348578063a457c2d714610366578063a9059cbb14610396578063a97ff8f9146103c657610173565b8063313ce56711610130578063313ce5671461024c578063395093511461026a5780633ccfd60b1461029a5780634c7c7160146102a457806370a08231146102c0578063715018a6146102f057610173565b806306fdde0314610178578063095ea7b31461019657806317abee1e146101c657806318160ddd146101e257806323b872dd146102005780632f6c493c14610230575b600080fd5b61018061051e565b60405161018d9190611d0f565b60405180910390f35b6101b060048036038101906101ab9190611dca565b6105b0565b6040516101bd9190611e25565b60405180910390f35b6101e060048036038101906101db9190611e40565b6105d3565b005b6101ea61071a565b6040516101f79190611e7c565b60405180910390f35b61021a60048036038101906102159190611e97565b610724565b6040516102279190611e25565b60405180910390f35b61024a60048036038101906102459190611e40565b610879565b005b610254610901565b6040516102619190611f06565b60405180910390f35b610284600480360381019061027f9190611dca565b61090a565b6040516102919190611e25565b60405180910390f35b6102a2610941565b005b6102be60048036038101906102b99190611dca565b610a06565b005b6102da60048036038101906102d59190611e40565b610b94565b6040516102e79190611e7c565b60405180910390f35b6102f8610ba6565b005b610314600480360381019061030f9190611e40565b610c2e565b6040516103219190611e7c565b60405180910390f35b610332610c46565b60405161033f9190611f30565b60405180910390f35b610350610c70565b60405161035d9190611d0f565b60405180910390f35b610380600480360381019061037b9190611dca565b610d02565b60405161038d9190611e25565b60405180910390f35b6103b060048036038101906103ab9190611dca565b610d79565b6040516103bd9190611e25565b60405180910390f35b6103e060048036038101906103db9190611e40565b610ecc565b6040516103ed9190611e25565b60405180910390f35b610410600480360381019061040b9190611e40565b610fc4565b60405161041d9190611e25565b60405180910390f35b610440600480360381019061043b9190611e40565b610fe4565b60405161044d9190611e25565b60405180910390f35b610470600480360381019061046b9190611e40565b61103a565b60405161047d9190611e7c565b60405180910390f35b6104a0600480360381019061049b9190611e40565b611082565b6040516104ad9190611e7c565b60405180910390f35b6104d060048036038101906104cb9190611f4b565b611182565b6040516104dd9190611e7c565b60405180910390f35b61050060048036038101906104fb9190611e40565b611209565b005b61051c60048036038101906105179190611e40565b611300565b005b60606003805461052d90611fba565b80601f016020809104026020016040519081016040528092919081815260200182805461055990611fba565b80156105a65780601f1061057b576101008083540402835291602001916105a6565b820191906000526020600020905b81548152906001019060200180831161058957829003601f168201915b5050505050905090565b6000806105bb611388565b90506105c8818585611390565b600191505092915050565b6105db611388565b73ffffffffffffffffffffffffffffffffffffffff166105f9610c46565b73ffffffffffffffffffffffffffffffffffffffff161461064f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064690612037565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361068857600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2411a6bc22519fe98a9db2ddbd83af278807704eac69a546c5d52fd3e0b2db918160405161070f9190611f30565b60405180910390a150565b6000600254905090565b600080151561073285610fe4565b1515146040518060400160405280601781526020017f45524332303a20546f6b656e73206973206c6f636b6564000000000000000000815250906107ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a39190611d0f565b60405180910390fd5b506107b684611559565b60001515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146040518060600160405280603081526020016125ee6030913990610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085b9190611d0f565b60405180910390fd5b50610870848484611655565b90509392505050565b610881611388565b73ffffffffffffffffffffffffffffffffffffffff1661089f610c46565b73ffffffffffffffffffffffffffffffffffffffff16146108f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ec90612037565b60405180910390fd5b6108fe81611684565b50565b60006012905090565b600080610915611388565b90506109368185856109278589611182565b6109319190612086565b611390565b600191505092915050565b610949611388565b73ffffffffffffffffffffffffffffffffffffffff16610967610c46565b73ffffffffffffffffffffffffffffffffffffffff16146109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b490612037565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610a03573d6000803e3d6000fd5b50565b610a0e611388565b73ffffffffffffffffffffffffffffffffffffffff16610a2c610c46565b73ffffffffffffffffffffffffffffffffffffffff1614610a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7990612037565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610abb57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f8e0c87def1994ae805798e3d7699d287b17cef0ce29d9daddbead3d8e7d2c5a08282604051610b889291906120ba565b60405180910390a15050565b6000610b9f8261103a565b9050919050565b610bae611388565b73ffffffffffffffffffffffffffffffffffffffff16610bcc610c46565b73ffffffffffffffffffffffffffffffffffffffff1614610c22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1990612037565b60405180910390fd5b610c2c6000611785565b565b60096020528060005260406000206000915090505481565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610c7f90611fba565b80601f0160208091040260200160405190810160405280929190818152602001828054610cab90611fba565b8015610cf85780601f10610ccd57610100808354040283529160200191610cf8565b820191906000526020600020905b815481529060010190602001808311610cdb57829003601f168201915b5050505050905090565b600080610d0d611388565b90506000610d1b8286611182565b905083811015610d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5790612155565b60405180910390fd5b610d6d8286868403611390565b60019250505092915050565b6000801515610d8733610fe4565b1515146040518060400160405280601781526020017f45524332303a20546f6b656e73206973206c6f636b656400000000000000000081525090610e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df89190611d0f565b60405180910390fd5b50610e0b33611559565b60001515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146040518060600160405280603081526020016125ee6030913990610eb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb09190611d0f565b60405180910390fd5b50610ec4838361184b565b905092915050565b600060011515600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151503610f6f5742600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050610fbf565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690505b919050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000801515600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151480611121575042600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b1561112f576000905061117d565b42600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117a9190612175565b90505b919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611211611388565b73ffffffffffffffffffffffffffffffffffffffff1661122f610c46565b73ffffffffffffffffffffffffffffffffffffffff1614611285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127c90612037565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb9061221b565b60405180910390fd5b6112fd81611785565b50565b611308611388565b73ffffffffffffffffffffffffffffffffffffffff16611326610c46565b73ffffffffffffffffffffffffffffffffffffffff161461137c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137390612037565b60405180910390fd5b61138581611869565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036113ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f6906122ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361146e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114659061233f565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161154c9190611e7c565b60405180910390a3505050565b60001515600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151503156116525742600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611651576000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b50565b600080611660611388565b905061166d85828561196a565b6116788585856119f6565b60019150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea906123ab565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f7e6adfec7e3f286831a0200a754127c171a2da564078722cb97704741bbdb0ea8160405161177a9190611f30565b60405180910390a150565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600061185f611858611388565b84846119f6565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036118d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cf906123ab565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f44427e3003a08f22cf803894075ac0297524e09e521fc1c15bc91741ce3dc1598160405161195f9190611f30565b60405180910390a150565b60006119768484611182565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146119f057818110156119e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d990612417565b60405180910390fd5b6119ef8484848403611390565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611a65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5c906124a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611acb9061253b565b60405180910390fd5b611adf838383611c75565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5c906125cd565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bf89190612086565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611c5c9190611e7c565b60405180910390a3611c6f848484611c7a565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611cb9578082015181840152602081019050611c9e565b60008484015250505050565b6000601f19601f8301169050919050565b6000611ce182611c7f565b611ceb8185611c8a565b9350611cfb818560208601611c9b565b611d0481611cc5565b840191505092915050565b60006020820190508181036000830152611d298184611cd6565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d6182611d36565b9050919050565b611d7181611d56565b8114611d7c57600080fd5b50565b600081359050611d8e81611d68565b92915050565b6000819050919050565b611da781611d94565b8114611db257600080fd5b50565b600081359050611dc481611d9e565b92915050565b60008060408385031215611de157611de0611d31565b5b6000611def85828601611d7f565b9250506020611e0085828601611db5565b9150509250929050565b60008115159050919050565b611e1f81611e0a565b82525050565b6000602082019050611e3a6000830184611e16565b92915050565b600060208284031215611e5657611e55611d31565b5b6000611e6484828501611d7f565b91505092915050565b611e7681611d94565b82525050565b6000602082019050611e916000830184611e6d565b92915050565b600080600060608486031215611eb057611eaf611d31565b5b6000611ebe86828701611d7f565b9350506020611ecf86828701611d7f565b9250506040611ee086828701611db5565b9150509250925092565b600060ff82169050919050565b611f0081611eea565b82525050565b6000602082019050611f1b6000830184611ef7565b92915050565b611f2a81611d56565b82525050565b6000602082019050611f456000830184611f21565b92915050565b60008060408385031215611f6257611f61611d31565b5b6000611f7085828601611d7f565b9250506020611f8185828601611d7f565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611fd257607f821691505b602082108103611fe557611fe4611f8b565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612021602083611c8a565b915061202c82611feb565b602082019050919050565b6000602082019050818103600083015261205081612014565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061209182611d94565b915061209c83611d94565b92508282019050808211156120b4576120b3612057565b5b92915050565b60006040820190506120cf6000830185611f21565b6120dc6020830184611e6d565b9392505050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b600061213f602583611c8a565b915061214a826120e3565b604082019050919050565b6000602082019050818103600083015261216e81612132565b9050919050565b600061218082611d94565b915061218b83611d94565b92508282039050818111156121a3576121a2612057565b5b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612205602683611c8a565b9150612210826121a9565b604082019050919050565b60006020820190508181036000830152612234816121f8565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612297602483611c8a565b91506122a28261223b565b604082019050919050565b600060208201905081810360008301526122c68161228a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612329602283611c8a565b9150612334826122cd565b604082019050919050565b600060208201905081810360008301526123588161231c565b9050919050565b7f45524332303a206c6f636b20746f20746865207a65726f206164647265737300600082015250565b6000612395601f83611c8a565b91506123a08261235f565b602082019050919050565b600060208201905081810360008301526123c481612388565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000612401601d83611c8a565b915061240c826123cb565b602082019050919050565b60006020820190508181036000830152612430816123f4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612493602583611c8a565b915061249e82612437565b604082019050919050565b600060208201905081810360008301526124c281612486565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612525602383611c8a565b9150612530826124c9565b604082019050919050565b6000602082019050818103600083015261255481612518565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006125b7602683611c8a565b91506125c28261255b565b604082019050919050565b600060208201905081810360008301526125e6816125aa565b905091905056fe45524332303a20546f6b656e732069732054696d65206c6f636b656420666f722073656e646572732061646472657373a2646970667358221220699aee976d7bf3fc3b7b648d18c264af915bf408b713a6ae3dc9bd5e4edb866864736f6c63430008130033
Verified Source Code Full Match
Compiler: v0.8.19+commit.7dd6d404
EVM: paris
Optimization: No
STOone.sol 652 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
//Reentrancy guard
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expbensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(
address(this).balance >= amount,
"Address: insufficient balance"
);
(bool success, ) = recipient.call{value: amount}("");
require(
success,
"Address: unable to send value, recipient may have reverted"
);
}
function functionCall(
address target,
bytes memory data
) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return
functionCallWithValue(
target,
data,
value,
"Address: low-level call with value failed"
);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(
address(this).balance >= value,
"Address: insufficient balance for call"
);
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(
data
);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(
address target,
bytes memory data
) internal view returns (bytes memory) {
return
functionStaticCall(
target,
data,
"Address: low-level static call failed"
);
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(
address target,
bytes memory data
) internal returns (bytes memory) {
return
functionDelegateCall(
target,
data,
"Address: low-level delegate call failed"
);
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(
address owner,
address spender
) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
using Address for address;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function getTotalSupply() internal virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(
address account
) public view virtual override returns (uint256) {
return _balances[account];
}
function _balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
function transfer(
address to,
uint256 amount
) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(
address owner,
address spender
) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(
address spender,
uint256 amount
) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(
address spender,
uint256 addedValue
) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
function decreaseAllowance(
address spender,
uint256 subtractedValue
) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(
fromBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(
currentAllowance >= amount,
"ERC20: insufficient allowance"
);
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract Lockable is Context {
event Locked(address account);
event Unlocked(address account);
mapping(address => bool) private _locked;
function locked(address _to) public view returns (bool) {
return _locked[_to];
}
function _lock(address to) internal virtual {
require(to != address(0), "ERC20: lock to the zero address");
_locked[to] = true;
emit Locked(to);
}
function _unlock(address to) internal virtual {
require(to != address(0), "ERC20: lock to the zero address");
_locked[to] = false;
emit Unlocked(to);
}
}
contract ERC20Base is Context, ERC20, Ownable, Lockable {
IERC20 token;
string internal constant TOKEN_LOCKED = "ERC20: Tokens is locked";
string internal constant TOKEN_TIME_LOCKED =
"ERC20: Tokens is Time locked for senders address";
//timeLocks
mapping(address => bool) public isTimeLocked;
mapping(address => uint256) public unlockTime;
event AddTimeLock(address to, uint256 unlockTime);
event RemoveTimeLock(address to);
function balanceOf(
address account
) public view virtual override returns (uint256) {
return _balanceOf(account);
}
constructor(
string memory name_,
string memory symbol_
) payable ERC20(name_, symbol_) {
token = IERC20(address(this));
}
function mint(address account, uint256 amount) internal virtual onlyOwner {
_mint(account, amount);
}
function _getTotalSupply() internal virtual returns (uint256) {
return getTotalSupply();
}
function lock(address to) public onlyOwner {
_lock(to);
}
function unlock(address to) public onlyOwner {
_unlock(to);
}
function addTimeLock(address to, uint256 _unlockTime) public onlyOwner {
require(to != address(0));
unlockTime[to] = _unlockTime;
isTimeLocked[to] = true;
emit AddTimeLock(to, _unlockTime);
}
function removeTimeLock(address to) public onlyOwner {
require(to != address(0));
isTimeLocked[to] = false;
emit RemoveTimeLock(to);
}
function checkAndUpdateTimeLock(address to) internal {
if (isTimeLocked[to] == false) return;
if (unlockTime[to] <= block.timestamp) {
isTimeLocked[to] = false;
}
}
function isCurrentlyLocked(address to) public view returns (bool _locked) {
if (isTimeLocked[to] == true) {
return unlockTime[to] > block.timestamp;
}
return isTimeLocked[to];
}
function getTimeToUnlock(
address to
) public view returns (uint256 _remSeconds) {
if (isTimeLocked[to] == false || unlockTime[to] <= block.timestamp) {
return 0;
}
return unlockTime[to] - block.timestamp;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
require(locked(from) == false, TOKEN_LOCKED);
checkAndUpdateTimeLock(from);
require(isTimeLocked[from] == false, TOKEN_TIME_LOCKED);
return _TransferFrom(from, to, amount);
}
function transfer(
address to,
uint256 amount
) public virtual override returns (bool) {
require(locked(msg.sender) == false, TOKEN_LOCKED);
checkAndUpdateTimeLock(msg.sender);
require(isTimeLocked[msg.sender] == false, TOKEN_TIME_LOCKED);
return _Transfer(to, amount);
}
/**
@dev transfer tokens from the owner's account to another account
@dev burntAmount is the amount of tokens to burn
*/
function _Transfer(address to, uint256 amount) internal returns (bool) {
_transfer(_msgSender(), to, amount);
return true;
}
function _TransferFrom(
address from,
address to,
uint256 amount
) internal returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
}
contract STOone is ERC20Base {
uint256 maxSupply = 10000000000 * (10 ** uint256(decimals())); //maximum amount of tokens that can be minted 1,000,000,000
constructor() payable ERC20Base("STOone", "STO") {
mint(msg.sender, maxSupply);
}
//A function to withdraw tokens from the contract
function withdraw() public onlyOwner {
payable(msg.sender).transfer(address(this).balance); //transfer all the tokens to the sender
}
}
Read Contract
_balanceOf 0xcca3e832 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getTimeToUnlock 0xdc555789 → uint256
isCurrentlyLocked 0xa97ff8f9 → bool
isTimeLocked 0xb8cc2751 → bool
locked 0xcbf9fe5f → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
unlockTime 0x76b467b7 → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
addTimeLock 0x4c7c7160
address to
uint256 _unlockTime
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
lock 0xf435f5a7
address to
removeTimeLock 0x17abee1e
address to
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unlock 0x2f6c493c
address to
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address