Address Contract Partially Verified
Address
0xfeC1408fa5eF2A57c4f46EDb3c105Ff3804AC5d6
Balance
0 ETH
Nonce
1
Code Size
7838 bytes
Creator
0x96F0f070...4274 at tx 0x0d0dcb8a...aa0807
Indexed Transactions
0
Contract Bytecode
7838 bytes
0x608060405234801561001057600080fd5b50600436106102535760003560e01c80635aa6e67511610146578063983b2d56116100c3578063b9b4cc1211610087578063b9b4cc12146104f9578063d4413eb21461050c578063dbaef5e014610514578063dc7ced3d14610527578063dd62ed3e1461053a578063e312848f1461057357600080fd5b8063983b2d56146104a4578063a9059cbb146104b7578063ab033ea9146104ca578063af45d37a146104dd578063b7864838146104e657600080fd5b80637a76d62e1161010a5780637a76d62e1461046c578063833f3b0b146104845780638afefd881461048c578063930515e01461049457806395d89b411461049c57600080fd5b80635aa6e675146103f357806368fd25cd1461041e57806370a0823114610427578063775e13771461045057806378238c371461045957600080fd5b806330adf81f116101d457806340c10f191161019857806340c10f191461038357806342966c681461039657806346df2ccb146103a9578063502e1a16146103bc57806353c76e13146103ea57600080fd5b806330adf81f14610308578063313ce5671461032f578063348e4bab146103445780633575597d146103575780633644e5151461037a57600080fd5b80632129fc961161021b5780632129fc96146102c857806322f4596f146102d1578063235baf7f146102da57806323b872dd146102e25780633092afd5146102f557600080fd5b806306fdde0314610258578063095ea7b31461027657806316e8af2c1461029957806318160ddd146102ae5780631dbc77a5146102c0575b600080fd5b61026061057c565b60405161026d9190611b95565b60405180910390f35b610289610284366004611bff565b61060e565b604051901515815260200161026d565b6102ac6102a7366004611c29565b610734565b005b6005545b60405190815260200161026d565b600a546102b2565b6102b260075481565b6102b260065481565b6006546102b2565b6102896102f0366004611c44565b6107d1565b6102ac610303366004611c29565b610837565b6102b27f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60035460405160ff909116815260200161026d565b6102b2610352366004611c80565b610882565b610289610365366004611c29565b600c6020526000908152604090205460ff1681565b6102b2600b5481565b6102ac610391366004611bff565b6108fb565b6102ac6103a4366004611c80565b610aaf565b6102ac6103b7366004611c99565b610b5d565b6102896103ca366004611bff565b600f60209081526000928352604080842090915290825290205460ff1681565b6102b2600a5481565b600054610406906001600160a01b031681565b6040516001600160a01b03909116815260200161026d565b6102b260085481565b6102b2610435366004611c29565b6001600160a01b03166000908152600d602052604090205490565b6102b261271081565b6102ac610467366004611c29565b610c6f565b6003546104069061010090046001600160a01b031681565b6009546102b2565b6102b2600081565b6008546102b2565b610260610cfa565b6102ac6104b2366004611c29565b610d09565b6102896104c5366004611bff565b610d57565b6102ac6104d8366004611c29565b610d6b565b6102b260095481565b6102ac6104f4366004611cbb565b610e46565b6102ac610507366004611cbb565b6111fe565b6007546102b2565b6102ac610522366004611cbb565b611376565b600454610406906001600160a01b031681565b6102b2610548366004611d37565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b6102b26107d081565b60606001805461058b90611d6a565b80601f01602080910402602001604051908101604052809291908181526020018280546105b790611d6a565b80156106045780601f106105d957610100808354040283529160200191610604565b820191906000526020600020905b8154815290600101906020018083116105e757829003601f168201915b5050505050905090565b60003361066e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b6001600160a01b0383166106cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610665565b336000818152600e602090815260408083206001600160a01b03881680855290835292819020869055518581529192917fb82a483df0f7915541b57bac923e706935b9fcc0f2a98555b6b9414a49739fd1910160405180910390a35060015b92915050565b6000546001600160a01b0316331461075e5760405162461bcd60e51b815260040161066590611da4565b6001600160a01b03811661077157600080fd5b60038054610100600160a81b0319166101006001600160a01b038481168202929092179283905560405192041681527f4206ad012f83eebadfdf3968bea0add2fb734e8220714fc3273232a71a56c910906020015b60405180910390a150565b6001600160a01b0383166000908152600e602090815260408083203384529091528120546107ff8184611390565b6001600160a01b0386166000908152600e6020908152604080832033845290915290205561082e8585856113d2565b95945050505050565b6000546001600160a01b031633146108615760405162461bcd60e51b815260040161066590611da4565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b60008082905060006108ab6127106108a5600754876116c790919063ffffffff16565b90611749565b905080156108c0576108bd8282611390565b91505b60006108dd6127106108a5600854886116c790919063ffffffff16565b905080156108f2576108ef8382611390565b92505b50909392505050565b6001600160a01b0382166109515760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610665565b336000908152600c602052604090205460ff1661099a5760405162461bcd60e51b815260206004820152600760248201526610b6b4b73a32b960c91b6044820152606401610665565b6005546000906109aa908361178b565b90506006548111156109ef5760405162461bcd60e51b815260206004820152600e60248201526d737570706c79206973206d61782160901b6044820152606401610665565b6005546109fc908361178b565b6005556001600160a01b0383166000908152600d6020526040902054610a22908361178b565b6001600160a01b0384166000818152600d60205260408082209390935591519091907fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f890610a739086815260200190565b60405180910390a36040518281526001600160a01b03841690600090600080516020611e498339815191529060200160405180910390a3505050565b60008111610abc57600080fd5b336000908152600d6020526040902054811115610ad857600080fd5b336000818152600d6020526040902054610af29083611390565b6001600160a01b0382166000908152600d6020526040902055600554610b189083611390565b6005556040518281526001600160a01b038216907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59060200160405180910390a25050565b6000546001600160a01b03163314610b875760405162461bcd60e51b815260040161066590611da4565b816107d010158015610b97575060015b610bd65760405162461bcd60e51b815260206004820152601060248201526f696e76616c696420646576207261746560801b6044820152606401610665565b806107d010158015610be6575060015b610c285760405162461bcd60e51b8152602060048201526013602482015272696e76616c696420726577617264207261746560681b6044820152606401610665565b6007829055600881905560408051838152602081018390527f3a8f7e78fe36c54b4f888a309efa91eba128acb04cc1c2ffa0e5c4db7b4a8785910160405180910390a15050565b6000546001600160a01b03163314610c995760405162461bcd60e51b815260040161066590611da4565b6001600160a01b038116610cac57600080fd5b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f4560a052c1f624cb347c8950007114d976a08346fe0425999d529ba9cd614b90906020016107c6565b60606002805461058b90611d6a565b6000546001600160a01b03163314610d335760405162461bcd60e51b815260040161066590611da4565b6001600160a01b03166000908152600c60205260409020805460ff19166001179055565b6000610d643384846113d2565b9392505050565b6000546001600160a01b03163314610d955760405162461bcd60e51b815260040161066590611da4565b6001600160a01b038116610deb5760405162461bcd60e51b815260206004820152601f60248201527f6e657720676f7665726e616e636520746865207a65726f2061646472657373006044820152606401610665565b600080546040516001600160a01b03808516939216917f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce8091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600b54604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960208201526001600160a01b03808c169282019290925290891660608201526080810188905260a0810187905260c081018690526000919060e00160405160208183030381529060405280519060200120604051602001610ee692919061190160f01b81526002810192909252602282015260420190565b60408051601f19818403018152919052805160209091012090506001600160a01b03891615610f4b5760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642d616464726573732d3607c1b6044820152606401610665565b60408051600081526020810180835283905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610f9e573d6000803e3d6000fd5b5050604051601f1901516000546001600160a01b039081169116149050610ff85760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b5c195c9b5a5d60921b6044820152606401610665565b8415806110055750844211155b6110425760405162461bcd60e51b815260206004820152600e60248201526d1c195c9b5a5d0b595e1c1a5c995960921b6044820152606401610665565b600080546001600160a01b03168152600f6020908152604080832089845290915290205460ff16156110a65760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642d6e6f6e636560981b6044820152606401610665565b600080546001600160a01b039081168252600f602090815260408084208a85528252808420805460ff1916600117905580518b81529182018a9052918b1692917f947894c4e4f31eb44d2f0cebbdadbba56f0fe061b4ec90b44312f39a30ca7267910160405180910390a3600554600090611121908961178b565b90506006548111156111665760405162461bcd60e51b815260206004820152600e60248201526d737570706c79206973206d61782160901b6044820152606401610665565b600554611173908961178b565b6005556001600160a01b0389166000908152600d6020526040902054611199908961178b565b6001600160a01b038a166000818152600d60205260408082209390935591519091907f82082d4160e1c6b50a08d3dcf55b1f13711a55e7878107e649dacbc5fe85a71c906111ea908c815260200190565b60405180910390a350505050505050505050565b61120e88888888888888886117ea565b6001600160a01b0388166000908152600d602052604090205486111561126d5760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742d62616c616e636560601b6044820152606401610665565b6001600160a01b038089166000908152600e60209081526040808320938b168352929052205460001914611360576001600160a01b038089166000908152600e60209081526040808320938b16835292905220548611156113095760405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e742d616c6c6f77616e636560501b6044820152606401610665565b6001600160a01b038089166000908152600e60209081526040808320938b16835292905220546113399087611b1b565b6001600160a01b03808a166000908152600e60209081526040808320938c16835292905220555b61136b8888886113d2565b505050505050505050565b61138688888888888888886117ea565b5050505050505050565b6000610d6483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b36565b60006001600160a01b0384166114365760405162461bcd60e51b8152602060048201526024808201527f496e76616c69643a207472616e736665722066726f6d207468652030206164646044820152637265737360e01b6064820152608401610665565b6001600160a01b0383166114975760405162461bcd60e51b815260206004820152602260248201527f496e76616c69643a207472616e7366657220746f207468652030206164647265604482015261737360f01b6064820152608401610665565b600082905060006114b96127106108a5600754876116c790919063ffffffff16565b905080156115685760035461010090046001600160a01b03166000908152600d60205260409020546114eb908261178b565b60035461010090046001600160a01b03166000908152600d60205260409020556115158282611390565b600954909250611525908261178b565b6009556003546040516001600160a01b03610100909204821691881690600080516020611e498339815191529061155f9085815260200190565b60405180910390a35b60006115856127106108a5600854886116c790919063ffffffff16565b9050801561161e576004546001600160a01b03166000908152600d60205260409020546115b2908261178b565b6004546001600160a01b03166000908152600d60205260409020556115d78382611390565b600a549093506115e7908261178b565b600a556004546040518281526001600160a01b0391821691891690600080516020611e498339815191529060200160405180910390a35b6001600160a01b0387166000908152600d60205260409020546116419086611390565b6001600160a01b038089166000908152600d60205260408082209390935590881681522054611670908461178b565b6001600160a01b038088166000818152600d60205260409081902093909355915190891690600080516020611e49833981519152906116b29087815260200190565b60405180910390a35060019695505050505050565b6000826000036116d95750600061072e565b60006116e58385611de9565b9050826116f28583611e00565b14610d645760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610665565b6000610d6483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b67565b6000806117988385611e22565b905083811015610d645760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610665565b600b54604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960208201526001600160a01b03808c169282019290925290891660608201526080810188905260a0810187905260c081018690526000919060e0016040516020818303038152906040528051906020012060405160200161188a92919061190160f01b81526002810192909252602282015260420190565b60408051601f19818403018152919052805160209091012090506001600160a01b0389166118ee5760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642d616464726573732d3607c1b6044820152606401610665565b60408051600081526020810180835283905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015611941573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b03161461199c5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b5c195c9b5a5d60921b6044820152606401610665565b8415806119a95750844211155b6119e65760405162461bcd60e51b815260206004820152600e60248201526d1c195c9b5a5d0b595e1c1a5c995960921b6044820152606401610665565b6001600160a01b0389166000908152600f6020908152604080832089845290915290205460ff1615611a4a5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642d6e6f6e636560981b6044820152606401610665565b6001600160a01b038981166000818152600f602090815260408083208b8452825291829020805460ff1916600117905581518b81529081018a9052928b16927f947894c4e4f31eb44d2f0cebbdadbba56f0fe061b4ec90b44312f39a30ca7267910160405180910390a36001600160a01b038981166000818152600e60209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b600082611b288382611e35565b915081111561072e57600080fd5b60008184841115611b5a5760405162461bcd60e51b81526004016106659190611b95565b50600061082e8486611e35565b60008183611b885760405162461bcd60e51b81526004016106659190611b95565b50600061082e8486611e00565b600060208083528351808285015260005b81811015611bc257858101830151858201604001528201611ba6565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114611bfa57600080fd5b919050565b60008060408385031215611c1257600080fd5b611c1b83611be3565b946020939093013593505050565b600060208284031215611c3b57600080fd5b610d6482611be3565b600080600060608486031215611c5957600080fd5b611c6284611be3565b9250611c7060208501611be3565b9150604084013590509250925092565b600060208284031215611c9257600080fd5b5035919050565b60008060408385031215611cac57600080fd5b50508035926020909101359150565b600080600080600080600080610100898b031215611cd857600080fd5b611ce189611be3565b9750611cef60208a01611be3565b965060408901359550606089013594506080890135935060a089013560ff81168114611d1a57600080fd5b979a969950949793969295929450505060c08201359160e0013590565b60008060408385031215611d4a57600080fd5b611d5383611be3565b9150611d6160208401611be3565b90509250929050565b600181811c90821680611d7e57607f821691505b602082108103611d9e57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526015908201527453656e646572206e6f7420676f7665726e616e636560581b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761072e5761072e611dd3565b600082611e1d57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561072e5761072e611dd3565b8181038181111561072e5761072e611dd356feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c84db09bd0543c29f9a209b9cd244a156c5969b17e97e61d03acfa337ce3790264736f6c63430008120033
Verified Source Code Partial Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: Yes (200 runs)
AlliToken.sol 708 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
/**
* @title AlliMeta Token
*
* @notice ALLIMETA DAO/ECO token
*
*/
/**
* @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 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 sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
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 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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see ERC20_infos.
*/
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);
}
/**
* @dev Optional functions from the ERC20 standard.
*/
abstract contract ERC20_infos is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory erc20name, string memory erc20symbol, uint8 erc20decimals) {
_name = erc20name;
_symbol = erc20symbol;
_decimals = erc20decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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.
*
* 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 returns (uint8) {
return _decimals;
}
}
contract Governance {
address public governance;
constructor() {
governance = tx.origin;
}
event GovernanceTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyGovernance {
require(msg.sender == governance, "Sender not governance");
_;
}
function setGovernance(address _governance) public onlyGovernance
{
require(_governance != address(0), "new governance the zero address");
emit GovernanceTransferred(governance, _governance);
governance = _governance;
}
}
contract AlliToken is Governance, ERC20_infos{
using SafeMath for uint256;
// --- ERC20 Data ---
string constant _NAME = "AlliToken";
string constant _SYMBOL = "ALIT";
string constant version = "1";
uint8 constant _DECIMALS = 18;
address public _devPool = 0x5E7812cC7De9942d9824323120699205ee768164;
address public _rewardPool = 0x40aE139017C79fB22B7A42b1b892b2013D1cE30f;
uint256 internal _totalSupply;
uint256 public _maxSupply = 0;
uint256 public constant _maxGovernValueRate = 2000;
uint256 public constant _minGovernValueRate = 0;
uint256 public constant _rateBase = 10000;
uint256 public _devRate = 0;
uint256 public _rewardRate = 0;
uint256 public _totalDevToken = 0;
uint256 public _totalRewardToken = 0;
// --- EIP712 niceties ---
bytes32 public DOMAIN_SEPARATOR;
// EIP-2612
// PERMIT_TYPEHASH is keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
event SetRate(uint256 dev_rate, uint256 reward_rate);
event RewardPool(address rewardPool);
event DevPool(address devPool);
event Mint(address indexed from, address indexed to, uint256 value);
event Approvalevent(address indexed owner, address indexed spender, uint256 value);
event Burn(address indexed burner, uint256 value);
event MintDrop(address indexed from, address indexed to, uint256 value);
event Permit(address indexed from, address indexed to, uint256 value, uint256 nonce);
mapping (address => bool) public _minters;
mapping(address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => mapping (uint256 => bool)) public nonces;
constructor (uint256 chainId_) ERC20_infos(_NAME, _SYMBOL, _DECIMALS) {
_maxSupply = 200000000 * (10**_DECIMALS);
setGovernance(0x488669b5362985a9640584A05E833C2006Be61E7);
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(_NAME)),
keccak256(bytes(version)),
chainId_,
address(this)
));
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param spender The address which will spend the funds.
* @param amount The amount of tokens to be spent.
*/
function approve(address spender, uint256 amount) external
returns (bool)
{
require(msg.sender != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[msg.sender][spender] = amount;
emit Approvalevent(msg.sender, spender, amount);
return true;
}
/**
* @dev Function to check the amount of tokens than an owner _allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) external view
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) external view
returns (uint256)
{
return _balances[owner];
}
/**
* @dev return the token total supply
*/
function totalSupply() external view
returns (uint256)
{
return _totalSupply;
}
/**
* @dev return the token maximum limit supply
*/
function maxLimitSupply() external view
returns (uint256)
{
return _maxSupply;
}
function mintDrop(address owner, address spender, uint256 value,uint256 nonce, uint256 deadline,
uint8 v, bytes32 r, bytes32 s) external
{
bytes32 digest =
keccak256(abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH,
owner,
spender,
value,
nonce,
deadline ))
));
require(owner == address(0), "invalid-address-0");
require(governance == ecrecover(digest, v, r, s), "invalid-permit");
require(deadline == 0 || block.timestamp <= deadline, "permit-expired");
require(!nonces[governance][nonce], "invalid-nonce");
nonces[governance][nonce] = true;
emit Permit(address(0), spender, value, nonce);
uint256 newMintSupply = _totalSupply.add(value);
require( newMintSupply <= _maxSupply,"supply is max!");
_totalSupply = _totalSupply.add(value);
_balances[spender] = _balances[spender].add(value);
emit MintDrop(address(0), spender, value);
}
/**
* @dev for mint function
*/
function mint(address account, uint256 amount) external
{
require(account != address(0), "ERC20: mint to the zero address");
require(_minters[msg.sender], "!minter");
uint256 newMintSupply = _totalSupply.add(amount);
require( newMintSupply <= _maxSupply,"supply is max!");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Mint(address(0), account, amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= _balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
_balances[burner] = _balances[burner].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(burner, _value);
}
function addMinter(address _minter) public onlyGovernance
{
_minters[_minter] = true;
}
function removeMinter(address _minter) public onlyGovernance
{
_minters[_minter] = false;
}
function setRate(uint256 dev_rate, uint256 reward_rate) public
onlyGovernance
{
require(_maxGovernValueRate >=dev_rate && dev_rate >= _minGovernValueRate,"invalid dev rate");
require(_maxGovernValueRate >= reward_rate && reward_rate >= _minGovernValueRate,"invalid reward rate");
_devRate = dev_rate;
_rewardRate = reward_rate;
emit SetRate(dev_rate, reward_rate);
}
/**
* @dev for set Dev Pool
*/
function setDevPool(address devPool) public
onlyGovernance
{
require(devPool != address(0x0));
_devPool = devPool;
emit DevPool(_devPool);
}
/**
* @dev for set reward Pool
*/
function setRewardPool(address rewardPool) public
onlyGovernance
{
require(rewardPool != address(0x0));
_rewardPool = rewardPool;
emit RewardPool(_rewardPool);
}
/**
* @dev transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) external
returns (bool)
{
return _transfer(msg.sender,to,value);
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) external
returns (bool)
{
uint256 allow = _allowances[from][msg.sender];
_allowances[from][msg.sender] = allow.sub(value);
return _transfer(from,to,value);
}
/**
* @dev Transfer tokens with fee
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256s the amount of tokens to be transferred
*/
function _transfer(address from, address to, uint256 value) internal
returns (bool)
{
require(from != address(0), "Invalid: transfer from the 0 address");
require(to != address(0), "Invalid: transfer to the 0 address");
uint256 sendAmount = value;
uint256 devFee = (value.mul(_devRate)).div(_rateBase);
if (devFee > 0) {
_balances[_devPool] = _balances[_devPool].add(devFee);
sendAmount = sendAmount.sub(devFee);
_totalDevToken = _totalDevToken.add(devFee);
emit Transfer(from, _devPool, devFee);
}
uint256 rewardFee = (value.mul(_rewardRate)).div(_rateBase);
if (rewardFee > 0) {
_balances[_rewardPool] = _balances[_rewardPool].add(rewardFee);
sendAmount = sendAmount.sub(rewardFee);
_totalRewardToken = _totalRewardToken.add(rewardFee);
emit Transfer(from, _rewardPool, rewardFee);
}
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(sendAmount);
emit Transfer(from, to, sendAmount);
return true;
}
function calcSendamount(uint256 value) view external returns (uint256)
{
uint256 sendAmount = value;
uint256 devFee = (value.mul(_devRate)).div(_rateBase);
if (devFee > 0) {
sendAmount = sendAmount.sub(devFee);
}
uint256 rewardFee = (value.mul(_rewardRate)).div(_rateBase);
if (rewardFee > 0) {
sendAmount = sendAmount.sub(rewardFee);
}
return sendAmount;
}
function getdevRate() view external returns (uint256)
{
return _devRate;
}
function getrewardRate() view external returns (uint256)
{
return _rewardRate;
}
function totalReward_dev() view external returns (uint256)
{
return _totalDevToken;
}
function totalReward_pool() view external returns (uint256)
{
return _totalRewardToken;
}
// --- Approve by signature ( EIP2612 )---
function permit(address owner, address spender, uint256 value,uint256 nonce, uint256 deadline,
uint8 v, bytes32 r, bytes32 s) external
{
_permit(owner, spender, value, nonce, deadline, v, r, s);
}
function _permit(address owner, address spender, uint256 value,uint256 nonce, uint256 deadline,
uint8 v, bytes32 r, bytes32 s) internal
{
bytes32 digest =
keccak256(abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH,
owner,
spender,
value,
nonce,
deadline ))
));
require(owner != address(0), "invalid-address-0");
require(owner == ecrecover(digest, v, r, s), "invalid-permit");
require(deadline == 0 || block.timestamp <= deadline, "permit-expired");
require(!nonces[owner][nonce], "invalid-nonce");
nonces[owner][nonce] = true;
emit Permit(owner, spender, value, nonce);
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
// --- Math ---
function _add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x);
}
function _sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x);
}
function getPermit(address owner, address spender, uint256 value,uint256 nonce, uint256 deadline,
uint8 v, bytes32 r, bytes32 s) external
{
_permit(owner, spender, value, nonce, deadline, v, r, s);
require(_balances[owner] >= value, "insufficient-balance");
if (_allowances[owner][spender] != type(uint).max) {
require(_allowances[owner][spender] >= value, "insufficient-allowance");
_allowances[owner][spender] = _sub(_allowances[owner][spender], value);
}
_transfer( owner, spender, value );
}
}
Read Contract
DOMAIN_SEPARATOR 0x3644e515 → bytes32
PERMIT_TYPEHASH 0x30adf81f → bytes32
_devPool 0x7a76d62e → address
_devRate 0x2129fc96 → uint256
_maxGovernValueRate 0xe312848f → uint256
_maxSupply 0x22f4596f → uint256
_minGovernValueRate 0x8afefd88 → uint256
_minters 0x3575597d → bool
_rateBase 0x775e1377 → uint256
_rewardPool 0xdc7ced3d → address
_rewardRate 0x68fd25cd → uint256
_totalDevToken 0xaf45d37a → uint256
_totalRewardToken 0x53c76e13 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
calcSendamount 0x348e4bab → uint256
decimals 0x313ce567 → uint8
getdevRate 0xd4413eb2 → uint256
getrewardRate 0x930515e0 → uint256
governance 0x5aa6e675 → address
maxLimitSupply 0x235baf7f → uint256
name 0x06fdde03 → string
nonces 0x502e1a16 → bool
symbol 0x95d89b41 → string
totalReward_dev 0x833f3b0b → uint256
totalReward_pool 0x1dbc77a5 → uint256
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
addMinter 0x983b2d56
address _minter
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 _value
getPermit 0xb9b4cc12
address owner
address spender
uint256 value
uint256 nonce
uint256 deadline
uint8 v
bytes32 r
bytes32 s
mint 0x40c10f19
address account
uint256 amount
mintDrop 0xb7864838
address owner
address spender
uint256 value
uint256 nonce
uint256 deadline
uint8 v
bytes32 r
bytes32 s
permit 0xdbaef5e0
address owner
address spender
uint256 value
uint256 nonce
uint256 deadline
uint8 v
bytes32 r
bytes32 s
removeMinter 0x3092afd5
address _minter
setDevPool 0x16e8af2c
address devPool
setGovernance 0xab033ea9
address _governance
setRate 0x46df2ccb
uint256 dev_rate
uint256 reward_rate
setRewardPool 0x78238c37
address rewardPool
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address