Address Contract Partially Verified
Address
0x6c28AeF8977c9B773996d0e8376d2EE379446F2f
Balance
0 ETH
Nonce
1
Code Size
4633 bytes
Creator
0x476307Da...1463 at tx 0x85d89954...bb2acb
Indexed Transactions
0
Contract Bytecode
4633 bytes
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806340c10f191161009757806395d89b411161006657806395d89b41146101d7578063a9059cbb146101df578063dd62ed3e146101f2578063fca3b5aa14610205576100f5565b806340c10f19146101925780635c11d62f146101a757806370a08231146101bc57806376c71ca1146101cf576100f5565b806318160ddd116100d357806318160ddd1461014d57806323b872dd1461016257806330b36cef14610175578063313ce5671461017d576100f5565b806306fdde03146100fa5780630754617214610118578063095ea7b31461012d575b600080fd5b610102610218565b60405161010f9190610eed565b60405180910390f35b61012061023d565b60405161010f9190610eb6565b61014061013b366004610b61565b61024c565b60405161010f9190610edf565b61015561030b565b60405161010f9190610f8e565b610140610170366004610b14565b610311565b61015561045a565b610185610460565b60405161010f9190610faa565b6101a56101a0366004610b61565b610465565b005b6101af61065b565b60405161010f9190610f9c565b6101556101ca366004610ab4565b610663565b610185610687565b61010261068c565b6101406101ed366004610b61565b6106ad565b610155610200366004610ada565b6106e9565b6101a5610213366004610ab4565b61071d565b604051806040016040528060098152602001680517569636b737761760bc1b81525081565b6001546001600160a01b031681565b6000806000198314156102625750600019610287565b610284836040518060600160405280602681526020016110c7602691396107b0565b90505b3360008181526003602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102f7908590610fb8565b60405180910390a360019150505b92915050565b60005481565b6001600160a01b03831660009081526003602090815260408083203380855290835281842054825160608101909352602680845291936001600160601b0390911692859261036992889291906110c7908301396107b0565b9050866001600160a01b0316836001600160a01b03161415801561039657506001600160601b0382811614155b156104405760006103c083836040518060600160405280603e815260200161113c603e91396107df565b6001600160a01b038981166000818152600360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610436908590610fb8565b60405180910390a3505b61044b87878361081e565b600193505050505b9392505050565b60025481565b601281565b6001546001600160a01b031633146104985760405162461bcd60e51b815260040161048f90610f2e565b60405180910390fd5b6002544210156104ba5760405162461bcd60e51b815260040161048f90610f4e565b6001600160a01b0382166104e05760405162461bcd60e51b815260040161048f90610f0e565b6104ee426301e1338061098a565b6002819055506000610518826040518060600160405280602381526020016110a4602391396107b0565b905061053461052d600054600260ff166109af565b60646109e9565b816001600160601b0316111561055c5760405162461bcd60e51b815260040161048f90610f3e565b610592610574600054836001600160601b031661098a565b6040518060600160405280602881526020016110ed602891396107b0565b6001600160601b0390811660009081556001600160a01b0385168152600460209081526040918290205482516060810190935260268084526105e4949190911692859290919061117a90830139610a2b565b6001600160a01b03841660008181526004602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061064e908590610fb8565b60405180910390a3505050565b6301e1338081565b6001600160a01b03166000908152600460205260409020546001600160601b031690565b600281565b60405180604001604052806005815260200164515549434b60d81b81525081565b6000806106d283604051806060016040528060278152602001611115602791396107b0565b90506106df33858361081e565b5060019392505050565b6001600160a01b0391821660009081526003602090815260408083209390941682529190915220546001600160601b031690565b6001546001600160a01b031633146107475760405162461bcd60e51b815260040161048f90610efe565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f691610786916001600160a01b03909116908490610ec4565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106107d75760405162461bcd60e51b815260040161048f9190610eed565b509192915050565b6000836001600160601b0316836001600160601b0316111582906108165760405162461bcd60e51b815260040161048f9190610eed565b505050900390565b6001600160a01b0383166108445760405162461bcd60e51b815260040161048f90610f5e565b6001600160a01b03821661086a5760405162461bcd60e51b815260040161048f90610f7e565b6001600160a01b0383166000908152600460209081526040918290205482516060810190935260378084526108b5936001600160601b0390921692859291906111a0908301396107df565b6001600160a01b03848116600090815260046020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352603180845261091d949190911692859290919061107390830139610a2b565b6001600160a01b038381166000818152600460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061064e908590610fb8565b6000828201838110156104535760405162461bcd60e51b815260040161048f90610f1e565b6000826109be57506000610305565b828202828482816109cb57fe5b04146104535760405162461bcd60e51b815260040161048f90610f6e565b600061045383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a67565b6000838301826001600160601b038087169083161015610a5e5760405162461bcd60e51b815260040161048f9190610eed565b50949350505050565b60008183610a885760405162461bcd60e51b815260040161048f9190610eed565b506000838581610a9457fe5b0495945050505050565b803561030581611052565b803561030581611069565b600060208284031215610ac657600080fd5b6000610ad28484610a9e565b949350505050565b60008060408385031215610aed57600080fd5b6000610af98585610a9e565b9250506020610b0a85828601610a9e565b9150509250929050565b600080600060608486031215610b2957600080fd5b6000610b358686610a9e565b9350506020610b4686828701610a9e565b9250506040610b5786828701610aa9565b9150509250925092565b60008060408385031215610b7457600080fd5b6000610b808585610a9e565b9250506020610b0a85828601610aa9565b610b9a81610fd3565b82525050565b610b9a81610fde565b6000610bb482610fc6565b610bbe8185610fca565b9350610bce818560208601611018565b610bd781611048565b9093019392505050565b6000610bee603f83610fca565b7f517569636b3a3a7365744d696e7465723a206f6e6c7920746865206d696e746581527f722063616e206368616e676520746865206d696e746572206164647265737300602082015260400192915050565b6000610c4d603083610fca565b7f517569636b3a3a6d696e743a2063616e6e6f74207472616e7366657220746f2081526f746865207a65726f206164647265737360801b602082015260400192915050565b6000610c9f601b83610fca565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000610cd8602583610fca565b7f517569636b3a3a6d696e743a206f6e6c7920746865206d696e7465722063616e815264081b5a5b9d60da1b602082015260400192915050565b6000610d1f601e83610fca565b7f517569636b3a3a6d696e743a206578636565646564206d696e74206361700000815260200192915050565b6000610d58602483610fca565b7f517569636b3a3a6d696e743a206d696e74696e67206e6f7420616c6c6f776564815263081e595d60e21b602082015260400192915050565b6000610d9e603d83610fca565b7f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207481527f72616e736665722066726f6d20746865207a65726f2061646472657373000000602082015260400192915050565b6000610dfd602183610fca565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000610e40603b83610fca565b7f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207481527f72616e7366657220746f20746865207a65726f20616464726573730000000000602082015260400192915050565b610b9a81610fef565b610b9a81610ff2565b610b9a81610ffb565b610b9a8161100d565b602081016103058284610b91565b60408101610ed28285610b91565b6104536020830184610b91565b602081016103058284610ba0565b602080825281016104538184610ba9565b6020808252810161030581610be1565b6020808252810161030581610c40565b6020808252810161030581610c92565b6020808252810161030581610ccb565b6020808252810161030581610d12565b6020808252810161030581610d4b565b6020808252810161030581610d91565b6020808252810161030581610df0565b6020808252810161030581610e33565b602081016103058284610e92565b602081016103058284610e9b565b602081016103058284610ea4565b602081016103058284610ead565b5190565b90815260200190565b600061030582610fe3565b151590565b6001600160a01b031690565b90565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061030582611001565b60005b8381101561103357818101518382015260200161101b565b83811115611042576000848401525b50505050565b601f01601f191690565b61105b81610fd3565b811461106657600080fd5b50565b61105b81610fef56fe517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a6d696e743a20616d6f756e7420657863656564732039362062697473517569636b3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473517569636b3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473517569636b3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473517569636b3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365517569636b3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a365627a7a723158200edfd7acf8a2d3c57f59e4753977902acb42588e53a6bf3420513fcbdde3aac36c6578706572696d656e74616cf564736f6c63430005110040
Verified Source Code Partial Match
Compiler: v0.5.17+commit.d19bba13
EVM: istanbul
Optimization: Yes (200 runs)
QuickToken.sol 386 lines
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @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, 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 addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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, string memory errorMessage) internal pure returns (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 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts 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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts 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) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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 mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract QuickToken {
/// @notice EIP-20 token name for this token
string public constant name = "Quickswap";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "QUICK";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public totalSupply = 1000000000000000000000000; // 1 million QUICK
/// @notice Address which may mint new tokens
address public minter;
/// @notice The timestamp after which minting may occur
uint public mintingAllowedAfter;
/// @notice Minimum time between mints
uint32 public constant minimumTimeBetweenMints = 1 days * 365;
/// @notice Cap on the percentage of totalSupply that can be minted at each mint
uint8 public constant mintCap = 2;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice An event thats emitted when the minter address is changed
event MinterChanged(address minter, address newMinter);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Quick token
* @param account The initial account to grant all the tokens
* @param minter_ The account with minting ability
* @param mintingAllowedAfter_ The timestamp after which minting may occur
*/
constructor(address account, address minter_, uint mintingAllowedAfter_) public {
require(mintingAllowedAfter_ >= block.timestamp, "Quick::constructor: minting can only begin after deployment");
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
minter = minter_;
emit MinterChanged(address(0), minter);
mintingAllowedAfter = mintingAllowedAfter_;
}
/**
* @notice Change the minter address
* @param minter_ The address of the new minter
*/
function setMinter(address minter_) external {
require(msg.sender == minter, "Quick::setMinter: only the minter can change the minter address");
emit MinterChanged(minter, minter_);
minter = minter_;
}
/**
* @notice Mint new tokens
* @param dst The address of the destination account
* @param rawAmount The number of tokens to be minted
*/
function mint(address dst, uint rawAmount) external {
require(msg.sender == minter, "Quick::mint: only the minter can mint");
require(block.timestamp >= mintingAllowedAfter, "Quick::mint: minting not allowed yet");
require(dst != address(0), "Quick::mint: cannot transfer to the zero address");
// record the mint
mintingAllowedAfter = SafeMath.add(block.timestamp, minimumTimeBetweenMints);
// mint the amount
uint96 amount = safe96(rawAmount, "Quick::mint: amount exceeds 96 bits");
require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Quick::mint: exceeded mint cap");
totalSupply = safe96(SafeMath.add(totalSupply, amount), "Quick::mint: totalSupply exceeds 96 bits");
// transfer the amount to the recipient
balances[dst] = add96(balances[dst], amount, "Quick::mint: transfer amount overflows");
emit Transfer(address(0), dst, amount);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Quick::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Quick::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Quick::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Quick::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Quick::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Quick::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
minimumTimeBetweenMints 0x5c11d62f → uint32
mintCap 0x76c71ca1 → uint8
minter 0x07546172 → address
mintingAllowedAfter 0x30b36cef → uint256
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 rawAmount
returns: bool
mint 0x40c10f19
address dst
uint256 rawAmount
setMinter 0xfca3b5aa
address minter_
transfer 0xa9059cbb
address dst
uint256 rawAmount
returns: bool
transferFrom 0x23b872dd
address src
address dst
uint256 rawAmount
returns: bool
Token Balances (2)
View Transfers →Recent Transactions
No transactions found for this address