USA Node
Top Transactions
Blocks
Staking
Tokens
Broadcast TXN
CLI Interface
Developer API
Smart Contract HQ
Contact Us
Donate
Node Status
Node:
Main Net - US
Search
Token Contract Details
Contract:
0x7b292f1ea85155edc2fe9703e938d569ded33db2
Name:
DogZilla
Symbol:
DOGZ
Total Supply:
940,000,000.00
Decimal:
18
Compiler Version:
v0.8.7
Published Contract:
Send Transactions
TNT-20 Transactions
TNT-721 Transactions
Contract
Contract ByteCode:
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80634dd18bf5116100b8578063a9059cbb1161007c578063a9059cbb14610352578063ab8e786f14610382578063d3b2f598146103b2578063d5abeb01146103bc578063dd62ed3e146103da578063f851a4401461040a57610137565b80634dd18bf51461029c5780634eb03f6e146102b857806370a08231146102d457806395d89b4114610304578063a457c2d71461032257610137565b806324e770d0116100ff57806324e770d0146101f6578063267822471461021457806329fb7ef614610232578063313ce5671461024e578063395093511461026c57610137565b806306fdde031461013c578063075461721461015a578063095ea7b31461017857806318160ddd146101a857806323b872dd146101c6575b600080fd5b610144610428565b60405161015191906117db565b60405180910390f35b6101626104ba565b60405161016f91906117a5565b60405180910390f35b610192600480360381019061018d9190611515565b6104e0565b60405161019f91906117c0565b60405180910390f35b6101b0610503565b6040516101bd919061195d565b60405180910390f35b6101e060048036038101906101db91906114c2565b61050d565b6040516101ed91906117c0565b60405180910390f35b6101fe61053c565b60405161020b919061195d565b60405180910390f35b61021c610546565b60405161022991906117a5565b60405180910390f35b61024c60048036038101906102479190611555565b61056c565b005b61025661063f565b6040516102639190611978565b60405180910390f35b61028660048036038101906102819190611515565b610656565b60405161029391906117c0565b60405180910390f35b6102b660048036038101906102b19190611455565b61068d565b005b6102d260048036038101906102cd9190611455565b610761565b005b6102ee60048036038101906102e99190611455565b61088e565b6040516102fb919061195d565b60405180910390f35b61030c6108d6565b60405161031991906117db565b60405180910390f35b61033c60048036038101906103379190611515565b610968565b60405161034991906117c0565b60405180910390f35b61036c60048036038101906103679190611515565b6109df565b60405161037991906117c0565b60405180910390f35b61039c60048036038101906103979190611515565b610a02565b6040516103a991906117c0565b60405180910390f35b6103ba610bb1565b005b6103c4610cff565b6040516103d1919061195d565b60405180910390f35b6103f460048036038101906103ef9190611482565b610d05565b604051610401919061195d565b60405180910390f35b610412610d8c565b60405161041f91906117a5565b60405180910390f35b60606003805461043790611ac1565b80601f016020809104026020016040519081016040528092919081815260200182805461046390611ac1565b80156104b05780601f10610485576101008083540402835291602001916104b0565b820191906000526020600020905b81548152906001019060200180831161049357829003601f168201915b5050505050905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806104eb610db2565b90506104f8818585610dba565b600191505092915050565b6000600254905090565b600080610518610db2565b9050610525858285610f85565b610530858585611011565b60019150509392505050565b6000600654905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f39061187d565b60405180910390fd5b806006819055507fd65d781db82f0bd55f732ea1b96f4c6565750df815c18a70962cd8405274e243600654604051610634919061195d565b60405180910390a150565b6000600560009054906101000a900460ff16905090565b600080610661610db2565b90506106828185856106738589610d05565b61067d91906119af565b610dba565b600191505092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461071d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107149061187d565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e89061187d565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f94a0a7c0a7a455351029a521046d4438bc63e58a1ee8d984d624eb3161583b2c600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161088391906117a5565b60405180910390a150565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546108e590611ac1565b80601f016020809104026020016040519081016040528092919081815260200182805461091190611ac1565b801561095e5780601f106109335761010080835404028352916020019161095e565b820191906000526020600020905b81548152906001019060200180831161094157829003601f168201915b5050505050905090565b600080610973610db2565b905060006109818286610d05565b9050838110156109c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bd9061191d565b60405180910390fd5b6109d38286868403610dba565b60019250505092915050565b6000806109ea610db2565b90506109f7818585611011565b600191505092915050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8b9061189d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ad25760009050610bab565b60003073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611582565b90506007548110610b67576000915050610bab565b600754610b7d848361128990919063ffffffff16565b1115610b9b57610b988160075461129f90919063ffffffff16565b92505b610ba584846112b5565b60019150505b92915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c38906118bd565b60405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fbfc8d7754fec5096becc28e0816011e8d0adcfe752ffa1c88924a7f88b00a41d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610cf591906117a5565b60405180910390a1565b60075481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e21906118fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e919061181d565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f78919061195d565b60405180910390a3505050565b6000610f918484610d05565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461100b5781811015610ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff49061183d565b60405180910390fd5b61100a8484848403610dba565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611078906118dd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e8906117fd565b60405180910390fd5b6110fc83838361140c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611182576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111799061185d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611270919061195d565b60405180910390a3611283848484611411565b50505050565b6000818361129791906119af565b905092915050565b600081836112ad9190611a05565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c9061193d565b60405180910390fd5b6113316000838361140c565b806002600082825461134391906119af565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113f4919061195d565b60405180910390a361140860008383611411565b5050565b505050565b505050565b60008135905061142581611e34565b92915050565b60008135905061143a81611e4b565b92915050565b60008151905061144f81611e4b565b92915050565b60006020828403121561146b5761146a611b51565b5b600061147984828501611416565b91505092915050565b6000806040838503121561149957611498611b51565b5b60006114a785828601611416565b92505060206114b885828601611416565b9150509250929050565b6000806000606084860312156114db576114da611b51565b5b60006114e986828701611416565b93505060206114fa86828701611416565b925050604061150b8682870161142b565b9150509250925092565b6000806040838503121561152c5761152b611b51565b5b600061153a85828601611416565b925050602061154b8582860161142b565b9150509250929050565b60006020828403121561156b5761156a611b51565b5b60006115798482850161142b565b91505092915050565b60006020828403121561159857611597611b51565b5b60006115a684828501611440565b91505092915050565b6115b881611a39565b82525050565b6115c781611a4b565b82525050565b60006115d882611993565b6115e2818561199e565b93506115f2818560208601611a8e565b6115fb81611b56565b840191505092915050565b600061161360238361199e565b915061161e82611b67565b604082019050919050565b600061163660228361199e565b915061164182611bb6565b604082019050919050565b6000611659601d8361199e565b915061166482611c05565b602082019050919050565b600061167c60268361199e565b915061168782611c2e565b604082019050919050565b600061169f601d8361199e565b91506116aa82611c7d565b602082019050919050565b60006116c2601e8361199e565b91506116cd82611ca6565b602082019050919050565b60006116e560258361199e565b91506116f082611ccf565b604082019050919050565b600061170860258361199e565b915061171382611d1e565b604082019050919050565b600061172b60248361199e565b915061173682611d6d565b604082019050919050565b600061174e60258361199e565b915061175982611dbc565b604082019050919050565b6000611771601f8361199e565b915061177c82611e0b565b602082019050919050565b61179081611a77565b82525050565b61179f81611a81565b82525050565b60006020820190506117ba60008301846115af565b92915050565b60006020820190506117d560008301846115be565b92915050565b600060208201905081810360008301526117f581846115cd565b905092915050565b6000602082019050818103600083015261181681611606565b9050919050565b6000602082019050818103600083015261183681611629565b9050919050565b600060208201905081810360008301526118568161164c565b9050919050565b600060208201905081810360008301526118768161166f565b9050919050565b6000602082019050818103600083015261189681611692565b9050919050565b600060208201905081810360008301526118b6816116b5565b9050919050565b600060208201905081810360008301526118d6816116d8565b9050919050565b600060208201905081810360008301526118f6816116fb565b9050919050565b600060208201905081810360008301526119168161171e565b9050919050565b6000602082019050818103600083015261193681611741565b9050919050565b6000602082019050818103600083015261195681611764565b9050919050565b60006020820190506119726000830184611787565b92915050565b600060208201905061198d6000830184611796565b92915050565b600081519050919050565b600082825260208201905092915050565b60006119ba82611a77565b91506119c583611a77565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156119fa576119f9611af3565b5b828201905092915050565b6000611a1082611a77565b9150611a1b83611a77565b925082821015611a2e57611a2d611af3565b5b828203905092915050565b6000611a4482611a57565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611aac578082015181840152602081019050611a91565b83811115611abb576000848401525b50505050565b60006002820490506001821680611ad957607f821691505b60208210811415611aed57611aec611b22565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f4f6e6c792061646d696e2063616e206d616b6520746869732063616c6c000000600082015250565b7f4f6e6c79206d696e7465722063616e206d616b6520746869732063616c6c0000600082015250565b7f4f6e6c792070656e64696e672061646d696e2063616e206d616b65207468697360008201527f2063616c6c000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e3d81611a39565b8114611e4857600080fd5b50565b611e5481611a77565b8114611e5f57600080fd5b5056fea26469706673582212201eeb6cff3dafb560594d2aa32c7df04274db2f376dfea1071076bf303e729d1164736f6c63430008070033
Published Contract:
// File: contracts/token/SafeMath.sol // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } // File: contracts/token/IERC20.sol // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity 0.8.7; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool); } // File: contracts/token/IERC20Metadata.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity 0.8.7; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ 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); } // File: contracts/token/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity 0.8.7; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: contracts/token/ERC20.sol // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity 0.8.7; /** * @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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead 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, IERC20Metadata { 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}. * * All two 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 override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override 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 default value returned by this function, unless * it's overridden. * * 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 override 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: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, 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}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ 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; } /** * @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) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, 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) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This 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: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ 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; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, 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: * * - `account` 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; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(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"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ 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); } } } /** * @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 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 {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} } // File: contracts/token/DogZillaToken.sol pragma solidity 0.8.7; contract DogZillaToken is ERC20 { using SafeMath for uint256; event UpdateStakerRewardPerBlock(uint256 newStakerRewardPerBlock); event UpdateAdmin(address newAdmin); event UpdateMinter(address newMinter); uint8 private _decimals; uint256 private _stakerRewardPerBlock; uint256 public maxSupply; address public minter; address public admin; address public pendingAdmin; constructor( string memory name_, string memory symbol_, uint8 decimals_, uint256 maxSupply_, address minter_, uint256 stakerRewardPerBlock_, address initDistrWallet_, uint256 initMintAmount_, address admin_ ) ERC20(name_, symbol_) { require(admin_ != address(0x0), "invalid admin address"); require(minter_ != address(0x0), "invalid minter_ address"); require(initDistrWallet_ != address(0x0), "invalid initDistrWallet_ address"); require(decimals_ != 0, "invalid decimals"); require(maxSupply_ != 0, "invalid maxSupply"); require(maxSupply_ < 2 ** 96, "maxSupply too large"); // if maxSupply is too large, it may lead to problems in staking reward calculation require( initMintAmount_ <= maxSupply_, "initial supply should not exceed the max supply" ); _decimals = decimals_; maxSupply = maxSupply_; minter = minter_; _stakerRewardPerBlock = stakerRewardPerBlock_; admin = admin_; _mint(initDistrWallet_, initMintAmount_); emit UpdateMinter(minter); emit UpdateAdmin(admin); emit UpdateStakerRewardPerBlock(_stakerRewardPerBlock); } function decimals() public view virtual override returns (uint8) { return _decimals; } // This method allow the minter (e.g. the ValidatorStakeManager contract) to mint new tokens to reward // the Subchain validator stakers function mintStakerReward( address account, uint256 amount ) external minterOnly returns (bool) { if (account == address(0x0)) { return false; } uint256 currentSupply = this.totalSupply(); if (currentSupply >= maxSupply) { return false; } if (currentSupply.add(amount) > maxSupply) { amount = maxSupply.sub(currentSupply); } _mint(account, amount); return true; } // This method tells the minter (e.g. the ValidatorStakeManager contract) how many new tokens are minted // per Main Chain block for the Subchain validator stakers function stakerRewardPerBlock() external view returns (uint256) { return _stakerRewardPerBlock; } function updateStakerRewardPerBlock( uint256 stakerRewardPerBlock_ ) external adminOnly { _stakerRewardPerBlock = stakerRewardPerBlock_; emit UpdateStakerRewardPerBlock(_stakerRewardPerBlock); } function updateMinter(address minter_) external adminOnly { minter = minter_; emit UpdateMinter(minter); } function setPendingAdmin(address admin_) external adminOnly { pendingAdmin = admin_; } function updateAdmin() external pendingAdminOnly { admin = pendingAdmin; emit UpdateAdmin(admin); } modifier adminOnly() { require(msg.sender == admin, "Only admin can make this call"); _; } modifier pendingAdminOnly() { require(msg.sender == pendingAdmin, "Only pending admin can make this call"); _; } modifier minterOnly() { require(msg.sender == minter, "Only minter can make this call"); _; } }
Contract ABI:
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"address","name":"minter_","type":"address"},{"internalType":"uint256","name":"stakerRewardPerBlock_","type":"uint256"},{"internalType":"address","name":"initDistrWallet_","type":"address"},{"internalType":"uint256","name":"initMintAmount_","type":"uint256"},{"internalType":"address","name":"admin_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"UpdateAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newMinter","type":"address"}],"name":"UpdateMinter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStakerRewardPerBlock","type":"uint256"}],"name":"UpdateStakerRewardPerBlock","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintStakerReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin_","type":"address"}],"name":"setPendingAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakerRewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter_","type":"address"}],"name":"updateMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakerRewardPerBlock_","type":"uint256"}],"name":"updateStakerRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]