Address Contract Verified
Address
0xFa14Fa6958401314851A17d6C5360cA29f74B57B
Balance
0 ETH
Nonce
1
Code Size
5217 bytes
Creator
0x03de6D7A...9900 at tx 0x458435c7...b76909
Indexed Transactions
0
Contract Bytecode
5217 bytes
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb14610325578063dd62ed3e14610351578063fbb0eb8b1461037f578063fe9d9303146103a057610100565b806370a08231146102c35780638f32d59b146102e957806395d89b41146102f1578063a457c2d7146102f957610100565b806323b872dd116100d357806323b872dd1461023b578063313ce56714610271578063395093511461028f578063627cdcb9146102bb57610100565b806306fdde0314610105578063095ea7b3146101825780630e76c7a0146101c257806318160ddd14610221575b600080fd5b61010d61044d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b0381351690602001356104e3565b604080519115158252519081900360200190f35b61021f60048036036101408110156101d957600080fd5b5080359060ff6020820135811691604081013591606082013591608081013582169160a08201359160c08101359160e08201351690610100810135906101200135610500565b005b6102296109a5565b60408051918252519081900360200190f35b6101ae6004803603606081101561025157600080fd5b506001600160a01b038135811691602081013590911690604001356109ab565b610279610a32565b6040805160ff9092168252519081900360200190f35b6101ae600480360360408110156102a557600080fd5b506001600160a01b038135169060200135610a3b565b61021f610a89565b610229600480360360208110156102d957600080fd5b50356001600160a01b0316610af8565b6101ae610b13565b61010d610b58565b6101ae6004803603604081101561030f57600080fd5b506001600160a01b038135169060200135610bb9565b6101ae6004803603604081101561033b57600080fd5b506001600160a01b038135169060200135610c21565b6102296004803603604081101561036757600080fd5b506001600160a01b0381358116916020013516610c35565b610387610c60565b6040805163ffffffff9092168252519081900360200190f35b61021f600480360360408110156103b657600080fd5b813591908101906040810160208201356401000000008111156103d857600080fd5b8201836020820111156103ea57600080fd5b8035906020019184600183028401116401000000008311171561040c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c73945050505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d95780601f106104ae576101008083540402835291602001916104d9565b820191906000526020600020905b8154815290600101906020018083116104bc57829003601f168201915b5050505050905090565b60006104f76104f0610d33565b8484610d37565b50600192915050565b610508610b13565b610549576040805162461bcd60e51b815260206004820152600d60248201526c26bab9ba1031329037bbb732b960991b604482015290519081900360640190fd5b600560019054906101000a90046001600160a01b03166001600160a01b031660018b60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001208b8b8b60405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610610573d6000803e3d6000fd5b505050602060405103516001600160a01b03161461066e576040805162461bcd60e51b81526020600482015260166024820152754e6f7420617070726f766564206279206f776e65723160501b604482015290519081900360640190fd5b600654604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018f905283518084039091018152605c83018085528151918301919091206000909152607c83018085525260ff8a16609c83015260bc820189905260dc820188905291516001600160a01b039093169260019260fc808401939192601f1981019281900390910190855afa15801561071f573d6000803e3d6000fd5b505050602060405103516001600160a01b03161461077d576040805162461bcd60e51b81526020600482015260166024820152752737ba1030b8383937bb32b210313c9037bbb732b91960511b604482015290519081900360640190fd5b600754604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018f905283518084039091018152605c83018085528151918301919091206000909152607c83018085525260ff8716609c83015260bc820186905260dc820185905291516001600160a01b039093169260019260fc808401939192601f1981019281900390910190855afa15801561082e573d6000803e3d6000fd5b505050602060405103516001600160a01b03161461088c576040805162461bcd60e51b81526020600482015260166024820152754e6f7420617070726f766564206279206f776e65723360501b604482015290519081900360640190fd5b600754600160801b8b04906fffffffffffffffffffffffffffffffff808d16919083169063ffffffff808516600160a01b9092041614610906576040805162461bcd60e51b815260206004820152601060248201526f0dcdedcc6ca40daeae6e840dac2e8c6d60831b604482015290519081900360640190fd5b6007805463ffffffff600160a01b80830482166001019091160263ffffffff60a01b1990911617905560055461094b906001600160a01b036101009091041683610e23565b600554604080516101009092046001600160a01b031682526020820184905280517f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe9281900390910190a150505050505050505050505050565b60025490565b60006109b8848484610f13565b610a28846109c4610d33565b610a2385604051806060016040528060288152602001611375602891396001600160a01b038a16600090815260016020526040812090610a02610d33565b6001600160a01b03168152602081019190915260400160002054919061106e565b610d37565b5060019392505050565b60055460ff1690565b60006104f7610a48610d33565b84610a238560016000610a59610d33565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611105565b610a91610b13565b610acc5760405162461bcd60e51b815260040180806020018281038252602381526020018061130a6023913960400191505060405180910390fd5b60078054600163ffffffff600160a01b808404821692909201160263ffffffff60a01b19909116179055565b6001600160a01b031660009081526020819052604090205490565b60055460009061010090046001600160a01b0316331480610b3e57506006546001600160a01b031633145b80610b5357506007546001600160a01b031633145b905090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d95780601f106104ae576101008083540402835291602001916104d9565b60006104f7610bc6610d33565b84610a23856040518060600160405280602581526020016114076025913960016000610bf0610d33565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061106e565b60006104f7610c2e610d33565b8484610f13565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600754600160a01b900463ffffffff1681565b610c7d3383611166565b7f1b0d1df39b95c18450406c31aa7c3c3fbafc15e3904d5994501abd24956f1cd333838360405180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610cf3578181015183820152602001610cdb565b50505050905090810190601f168015610d205780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050565b3390565b6001600160a01b038316610d7c5760405162461bcd60e51b81526004018080602001828103825260248152602001806113e36024913960400191505060405180910390fd5b6001600160a01b038216610dc15760405162461bcd60e51b815260040180806020018281038252602281526020018061132d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038216610e7e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610e8a60008383611262565b600254610e979082611105565b6002556001600160a01b038216600090815260208190526040902054610ebd9082611105565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038316610f585760405162461bcd60e51b81526004018080602001828103825260258152602001806113be6025913960400191505060405180910390fd5b6001600160a01b038216610f9d5760405162461bcd60e51b81526004018080602001828103825260238152602001806112c56023913960400191505060405180910390fd5b610fa8838383611262565b610fe58160405180606001604052806026815260200161134f602691396001600160a01b038616600090815260208190526040902054919061106e565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546110149082611105565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110c25781810151838201526020016110aa565b50505050905090810190601f1680156110ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561115f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166111ab5760405162461bcd60e51b815260040180806020018281038252602181526020018061139d6021913960400191505060405180910390fd5b6111b782600083611262565b6111f4816040518060600160405280602281526020016112e8602291396001600160a01b038516600090815260208190526040902054919061106e565b6001600160a01b03831660009081526020819052604090205560025461121a9082611267565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b505050565b6000828211156112be576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f6e6c79206f776e6572732063616e20696e6372656d656e7420746865206e6f6e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204142c8d2568bbd0072877c7ea16e01c8c65e7e10b4b879bcea6ad93a4256e83264736f6c63430007060033
Verified Source Code Full Match
Compiler: v0.7.6+commit.7338295f
EVM: istanbul
Optimization: Yes (200 runs)
SaitoToken.sol 67 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.0 <0.8.0;
//import "./lib/openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract SaitoToken is ERC20 {
address owner1;
address owner2;
address owner3;
uint32 public mintingNonce = 0;
constructor (string memory name_, string memory symbol_) ERC20(name_, symbol_) {
// The tests will replace these keys in the contract binary with the test owner keys.
// These must be replaced with the real owner keys during deployment, however this will
// also cause the tests to break, so please do not commit changes to these.
owner1 = 0x41Afad17a0B0e4135022CcC448D7FCe0C6469d16;
owner2 = 0x5aC2F364482759C54c9A08B8a16F5723C8eD4Cf0;
owner3 = 0xA357D59D38dD963d1930efb55e1a262b42c53748;
}
function isOwner() public view returns (bool) {
return msg.sender == owner1 || msg.sender == owner2 || msg.sender == owner3;
}
function incrementNonce() external {
require(isOwner(), "Only owners can increment the nonce");
mintingNonce++;
}
/**
* Creates new tokens. Can only be called by one of the three owners. Includes
* signatures from each of the 3 owners.
* The signed messages is a bytes32(equivalent to uint256), which includes the
* nonce and the amount intended to be minted. The network ID is not included,
* which means owner keys cannot be shared across networks because of the
* possibility of replay. The lower 128 bits of the signedMessage contain
* the amount to be minted, and the upper 128 bits contain the nonce.
*/
function mint(bytes32 signedMessage, uint8 sigV1, bytes32 sigR1, bytes32 sigS1, uint8 sigV2, bytes32 sigR2, bytes32 sigS2, uint8 sigV3, bytes32 sigR3, bytes32 sigS3) external {
require(isOwner(), "Must be owner");
require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", signedMessage)), sigV1, sigR1, sigS1) == owner1, "Not approved by owner1");
require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", signedMessage)), sigV2, sigR2, sigS2) == owner2, "Not approved by owner2");
require(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", signedMessage)), sigV3, sigR3, sigS3) == owner3, "Not approved by owner3");
// cast message to a uint256
uint256 signedMessageUint256 = uint256(signedMessage);
// bitwise-and the lower 128 bits of message to get the amount
uint256 amount = signedMessageUint256 & (2**128-1);
// right-shift the message by 128 bits to get the nonce in the correct position
signedMessageUint256 = signedMessageUint256 / (2**128);
// bitwise-and the message by 128 bits to get the nonce
uint32 nonce = uint32(signedMessageUint256 & (2**128-1));
require(nonce == mintingNonce, "nonce must match");
mintingNonce += 1;
_mint(owner1, amount);
emit Minted(owner1, amount);
}
function burn(uint256 amount, bytes memory data) external {
super._burn(msg.sender, amount);
emit Burned(msg.sender, amount, data);
}
event Minted(address receiver, uint256 amount);
event Burned(address from, uint256 amount, bytes data);
//event Minted(address indexed to, uint256 amount);
//event Burned(address indexed from, uint256 amount, bytes data);
}
SafeMath.sol 214 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
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) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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) {
// 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) {
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) {
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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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. 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) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b > 0, "SafeMath: modulo by zero");
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) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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) {
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) {
require(b > 0, errorMessage);
return a % b;
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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 payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
ERC20.sol 306 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.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 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
/**
* @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 {_setupDecimals} is
* called.
*
* 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 _decimals;
}
/**
* @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);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
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);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(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 = _totalSupply.add(amount);
_balances[account] = _balances[account].add(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);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
/**
* @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 { }
}
IERC20.sol 77 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isOwner 0x8f32d59b → bool
mintingNonce 0xfbb0eb8b → uint32
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0xfe9d9303
uint256 amount
bytes data
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
incrementNonce 0x627cdcb9
No parameters
mint 0x0e76c7a0
bytes32 signedMessage
uint8 sigV1
bytes32 sigR1
bytes32 sigS1
uint8 sigV2
bytes32 sigR2
bytes32 sigS2
uint8 sigV3
bytes32 sigR3
bytes32 sigS3
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address