Address Contract Verified
Address
0x3eE6E46f52c475c52040b934745501F2A0cEa252
Balance
0 ETH
Nonce
1
Code Size
9203 bytes
Creator
0xB88cD56e...54db at tx 0xfd5075ae...ffa2e1
Indexed Transactions
0
Contract Bytecode
9203 bytes
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b857806395d89b411161007c57806395d89b4114610340578063a457c2d71461035e578063a54eb8261461038e578063a9059cbb146103be578063dd62ed3e146103ee578063f2fde38b1461041e57610137565b806370a082311461029c578063715018a6146102cc57806376fd9d4d146102d657806379cc6790146103065780638da5cb5b1461032257610137565b8063355274ea116100ff578063355274ea146101f657806339509351146102145780633a03171c1461024457806342966c68146102625780636fe574281461027e57610137565b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461018a57806323b872dd146101a8578063313ce567146101d8575b600080fd5b61014461043a565b6040516101519190611b68565b60405180910390f35b610174600480360381019061016f919061184b565b6104cc565b6040516101819190611b4d565b60405180910390f35b6101926104ea565b60405161019f9190611d6a565b60405180910390f35b6101c260048036038101906101bd91906117c0565b6104f4565b6040516101cf9190611b4d565b60405180910390f35b6101e06105ad565b6040516101ed9190611d85565b60405180910390f35b6101fe6105b6565b60405161020b9190611d6a565b60405180910390f35b61022e6004803603810190610229919061184b565b6105c0565b60405161023b9190611b4d565b60405180910390f35b61024c61066c565b6040516102599190611d6a565b60405180910390f35b61027c60048036038101906102779190611887565b61067a565b005b61028661068e565b6040516102939190611b4d565b60405180910390f35b6102b660048036038101906102b1919061175b565b61077e565b6040516102c39190611d6a565b60405180910390f35b6102d46107c6565b005b6102f060048036038101906102eb919061175b565b610903565b6040516102fd9190611b4d565b60405180910390f35b610320600480360381019061031b919061184b565b610923565b005b61032a6109a7565b6040516103379190611b32565b60405180910390f35b6103486109d1565b6040516103559190611b68565b60405180910390f35b6103786004803603810190610373919061184b565b610a63565b6040516103859190611b4d565b60405180910390f35b6103a860048036038101906103a3919061180f565b610b57565b6040516103b59190611b4d565b60405180910390f35b6103d860048036038101906103d3919061184b565b610c36565b6040516103e59190611b4d565b60405180910390f35b61040860048036038101906104039190611784565b610ced565b6040516104159190611d6a565b60405180910390f35b6104386004803603810190610433919061175b565b610d74565b005b60606003805461044990611ece565b80601f016020809104026020016040519081016040528092919081815260200182805461047590611ece565b80156104c25780601f10610497576101008083540402835291602001916104c2565b820191906000526020600020905b8154815290600101906020018083116104a557829003601f168201915b5050505050905090565b60006104e06104d9610fc7565b8484610fcf565b6001905092915050565b6000600254905090565b6000600660149054906101000a900460ff168061055a5750600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b610599576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059090611c2a565b60405180910390fd5b6105a484848461119a565b90509392505050565b60006012905090565b6000600554905090565b60006106626105cd610fc7565b8484600160006105db610fc7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065d9190611dbc565b610fcf565b6001905092915050565b69152d02c7e14af680000081565b61068b610685610fc7565b8261129b565b50565b6000610698610fc7565b73ffffffffffffffffffffffffffffffffffffffff166106b66109a7565b73ffffffffffffffffffffffffffffffffffffffff161461070c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070390611c8a565b60405180910390fd5b600660149054906101000a900460ff161561075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390611c4a565b60405180910390fd5b6001600660146101000a81548160ff0219169083151502179055506001905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6107ce610fc7565b73ffffffffffffffffffffffffffffffffffffffff166107ec6109a7565b73ffffffffffffffffffffffffffffffffffffffff1614610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083990611c8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60076020528060005260406000206000915054906101000a900460ff1681565b600061093683610931610fc7565b610ced565b90508181101561097b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097290611caa565b60405180910390fd5b61099883610987610fc7565b84846109939190611e12565b610fcf565b6109a2838361129b565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546109e090611ece565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0c90611ece565b8015610a595780601f10610a2e57610100808354040283529160200191610a59565b820191906000526020600020905b815481529060010190602001808311610a3c57829003601f168201915b5050505050905090565b60008060016000610a72610fc7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610b2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2690611d4a565b60405180910390fd5b610b4c610b3a610fc7565b858584610b479190611e12565b610fcf565b600191505092915050565b6000610b61610fc7565b73ffffffffffffffffffffffffffffffffffffffff16610b7f6109a7565b73ffffffffffffffffffffffffffffffffffffffff1614610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcc90611c8a565b60405180910390fd5b81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b6000600660149054906101000a900460ff1680610c9c5750600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b610cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd290611c2a565b60405180910390fd5b610ce5838361146f565b905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d7c610fc7565b73ffffffffffffffffffffffffffffffffffffffff16610d9a6109a7565b73ffffffffffffffffffffffffffffffffffffffff1614610df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de790611c8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5790611bca565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610f2b838383610fc2565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fbd57610f686105b6565b81610f716104ea565b610f7b9190611dbc565b1115610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390611d0a565b60405180910390fd5b5b505050565b505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561103f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103690611d2a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690611bea565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161118d9190611d6a565b60405180910390a3505050565b60006111a784848461148d565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006111f2610fc7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015611272576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126990611c6a565b60405180910390fd5b61128f8561127e610fc7565b858461128a9190611e12565b610fcf565b60019150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130290611cca565b60405180910390fd5b6113178260008361170c565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490611baa565b60405180910390fd5b81816113a99190611e12565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008282546113fd9190611e12565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516114629190611d6a565b60405180910390a3505050565b600061148361147c610fc7565b848461148d565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f490611cea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561156d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156490611b8a565b60405180910390fd5b61157883838361170c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f590611c0a565b60405180910390fd5b818161160a9190611e12565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461169a9190611dbc565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116fe9190611d6a565b60405180910390a350505050565b611717838383610f20565b505050565b60008135905061172b81612378565b92915050565b6000813590506117408161238f565b92915050565b600081359050611755816123a6565b92915050565b60006020828403121561176d57600080fd5b600061177b8482850161171c565b91505092915050565b6000806040838503121561179757600080fd5b60006117a58582860161171c565b92505060206117b68582860161171c565b9150509250929050565b6000806000606084860312156117d557600080fd5b60006117e38682870161171c565b93505060206117f48682870161171c565b925050604061180586828701611746565b9150509250925092565b6000806040838503121561182257600080fd5b60006118308582860161171c565b925050602061184185828601611731565b9150509250929050565b6000806040838503121561185e57600080fd5b600061186c8582860161171c565b925050602061187d85828601611746565b9150509250929050565b60006020828403121561189957600080fd5b60006118a784828501611746565b91505092915050565b6118b981611e46565b82525050565b6118c881611e58565b82525050565b60006118d982611da0565b6118e38185611dab565b93506118f3818560208601611e9b565b6118fc81611f5e565b840191505092915050565b6000611914602383611dab565b915061191f82611f6f565b604082019050919050565b6000611937602283611dab565b915061194282611fbe565b604082019050919050565b600061195a602683611dab565b91506119658261200d565b604082019050919050565b600061197d602283611dab565b91506119888261205c565b604082019050919050565b60006119a0602683611dab565b91506119ab826120ab565b604082019050919050565b60006119c3601083611dab565b91506119ce826120fa565b602082019050919050565b60006119e6600f83611dab565b91506119f182612123565b602082019050919050565b6000611a09602883611dab565b9150611a148261214c565b604082019050919050565b6000611a2c602083611dab565b9150611a378261219b565b602082019050919050565b6000611a4f602483611dab565b9150611a5a826121c4565b604082019050919050565b6000611a72602183611dab565b9150611a7d82612213565b604082019050919050565b6000611a95602583611dab565b9150611aa082612262565b604082019050919050565b6000611ab8601983611dab565b9150611ac3826122b1565b602082019050919050565b6000611adb602483611dab565b9150611ae6826122da565b604082019050919050565b6000611afe602583611dab565b9150611b0982612329565b604082019050919050565b611b1d81611e84565b82525050565b611b2c81611e8e565b82525050565b6000602082019050611b4760008301846118b0565b92915050565b6000602082019050611b6260008301846118bf565b92915050565b60006020820190508181036000830152611b8281846118ce565b905092915050565b60006020820190508181036000830152611ba381611907565b9050919050565b60006020820190508181036000830152611bc38161192a565b9050919050565b60006020820190508181036000830152611be38161194d565b9050919050565b60006020820190508181036000830152611c0381611970565b9050919050565b60006020820190508181036000830152611c2381611993565b9050919050565b60006020820190508181036000830152611c43816119b6565b9050919050565b60006020820190508181036000830152611c63816119d9565b9050919050565b60006020820190508181036000830152611c83816119fc565b9050919050565b60006020820190508181036000830152611ca381611a1f565b9050919050565b60006020820190508181036000830152611cc381611a42565b9050919050565b60006020820190508181036000830152611ce381611a65565b9050919050565b60006020820190508181036000830152611d0381611a88565b9050919050565b60006020820190508181036000830152611d2381611aab565b9050919050565b60006020820190508181036000830152611d4381611ace565b9050919050565b60006020820190508181036000830152611d6381611af1565b9050919050565b6000602082019050611d7f6000830184611b14565b92915050565b6000602082019050611d9a6000830184611b23565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611dc782611e84565b9150611dd283611e84565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611e0757611e06611f00565b5b828201905092915050565b6000611e1d82611e84565b9150611e2883611e84565b925082821015611e3b57611e3a611f00565b5b828203905092915050565b6000611e5182611e64565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611eb9578082015181840152602081019050611e9e565b83811115611ec8576000848401525b50505050565b60006002820490506001821680611ee657607f821691505b60208210811415611efa57611ef9611f2f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f43616e2d6e6f742d7472616e7366657200000000000000000000000000000000600082015250565b7f416c72656164792d616c6c6f7765640000000000000000000000000000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332304361707065643a2063617020657863656564656400000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61238181611e46565b811461238c57600080fd5b50565b61239881611e58565b81146123a357600080fd5b50565b6123af81611e84565b81146123ba57600080fd5b5056fea2646970667358221220a04f483b8082cc52044dc205f564c2fa56e6be3c8fdfb28496d6479cc5681b9f64736f6c63430008010033
Verified Source Code Full Match
Compiler: v0.8.1+commit.df193b15
EVM: istanbul
Optimization: No
ERC20.sol 303 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Context.sol";
import "./IERC20.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
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);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
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");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
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);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
DISCO2.sol 63 lines
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20.sol";
import "./ERC20Capped.sol";
import "./ERC20Burnable.sol";
import "./Ownable.sol";
contract DSCVR is ERC20, ERC20Capped, ERC20Burnable, Ownable {
uint256 public constant HARD_CAP = 100_000 * (10 ** 18); // 100k tokens
bool allowTransfer;
mapping (address => bool) public whiteListTransfer;
modifier isUnlocked() {
require(allowTransfer || whiteListTransfer[msg.sender], "Can-not-transfer");
_;
}
/**
* @dev Constructor function of DSCVR Token
* @dev set name, symbol and decimal of token
* @dev mint hardcap to deployer
*/
constructor() public
ERC20("DSCVR", "DSCVR")
ERC20Capped(HARD_CAP) {
whiteListTransfer[_msgSender()] = true;
_mint(msg.sender, HARD_CAP);
}
/**
* @dev Admin whitelist/un-whitelist transfer
* @dev to allow address transfer
* @dev token before allowTransferOn
*/
function adminWhiteList(address _whitelistAddr, bool _whiteList) public onlyOwner returns (bool) {
whiteListTransfer[_whitelistAddr] = _whiteList;
return true;
}
/**
* @dev Admin can set allowTransfer to allow user transfer token normally
*/
function adminUnlockTransfer() public onlyOwner returns (bool) {
require(!allowTransfer, "Already-allowed");
allowTransfer = true;
return true;
}
function transfer(address to, uint amount) public isUnlocked override(ERC20) returns (bool) {
return super.transfer(to, amount);
}
function transferFrom(address from, address to, uint amount) public isUnlocked override(ERC20) returns (bool) {
return super.transferFrom(from, to, amount);
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Capped) {
super._beforeTokenTransfer(from, to, amount);
}
}
IERC20.sol 77 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
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 GSN 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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
Ownable.sol 68 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./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 () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
ERC20Capped.sol 43 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20.sol";
/**
* @dev Extension of {ERC20} that adds a cap to the supply of tokens.
*/
abstract contract ERC20Capped is ERC20 {
uint256 private _cap;
/**
* @dev Sets the value of the `cap`. This value is immutable, it can only be
* set once during construction.
*/
constructor (uint256 cap_) {
require(cap_ > 0, "ERC20Capped: cap is 0");
_cap = cap_;
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view virtual returns (uint256) {
return _cap;
}
/**
* @dev See {ERC20-_beforeTokenTransfer}.
*
* Requirements:
*
* - minted tokens must not cause the total supply to go over the cap.
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) { // When minting tokens
require(totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
}
}
}
ERC20Burnable.sol 40 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Context.sol";
import "./ERC20.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), currentAllowance - amount);
_burn(account, amount);
}
}
Read Contract
HARD_CAP 0x3a03171c → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
cap 0x355274ea → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
whiteListTransfer 0x76fd9d4d → bool
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
adminUnlockTransfer 0x6fe57428
No parameters
returns: bool
adminWhiteList 0xa54eb826
address _whitelistAddr
bool _whiteList
returns: bool
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
burnFrom 0x79cc6790
address account
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
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
Recent Transactions
No transactions found for this address