Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 258 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 21570491 | 29 days ago | IN | 0 ETH | 0.00028238 | ||||
Approve | 21376459 | 56 days ago | IN | 0 ETH | 0.00065191 | ||||
Transfer | 21284306 | 69 days ago | IN | 0 ETH | 0.00094272 | ||||
Approve | 21270780 | 71 days ago | IN | 0 ETH | 0.00070451 | ||||
Approve | 21250508 | 73 days ago | IN | 0 ETH | 0.00072874 | ||||
Approve | 21250334 | 73 days ago | IN | 0 ETH | 0.00054303 | ||||
Approve | 21207202 | 80 days ago | IN | 0 ETH | 0.00040697 | ||||
Transfer | 21192473 | 82 days ago | IN | 0 ETH | 0.00142809 | ||||
Approve | 21183619 | 83 days ago | IN | 0 ETH | 0.00120796 | ||||
Transfer | 21173651 | 84 days ago | IN | 0 ETH | 0.00402831 | ||||
Approve | 21173174 | 84 days ago | IN | 0 ETH | 0.001733 | ||||
Approve | 21011041 | 107 days ago | IN | 0 ETH | 0.00033138 | ||||
Approve | 20994433 | 109 days ago | IN | 0 ETH | 0.00040781 | ||||
Approve | 20993227 | 109 days ago | IN | 0 ETH | 0.00079211 | ||||
Approve | 20993188 | 109 days ago | IN | 0 ETH | 0.000856 | ||||
Approve | 20993159 | 109 days ago | IN | 0 ETH | 0.00153828 | ||||
Approve | 20978709 | 111 days ago | IN | 0 ETH | 0.00120018 | ||||
Transfer | 20867362 | 127 days ago | IN | 0 ETH | 0.0005716 | ||||
Approve | 20754617 | 143 days ago | IN | 0 ETH | 0.00013806 | ||||
Approve | 20744365 | 144 days ago | IN | 0 ETH | 0.00038309 | ||||
Approve | 20741268 | 145 days ago | IN | 0 ETH | 0.00016315 | ||||
Approve | 20657336 | 156 days ago | IN | 0 ETH | 0.00006424 | ||||
Approve | 20610799 | 163 days ago | IN | 0 ETH | 0.00003206 | ||||
Approve | 20591263 | 165 days ago | IN | 0 ETH | 0.00007457 | ||||
Approve | 20385126 | 194 days ago | IN | 0 ETH | 0.00043728 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
UnaWEMIX
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-27 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.10; library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } } enum DataVersion {invalid, common} library CommonDataFormat { struct CommonData { bytes4 selector; address contractAddress; address account; address requester; } function encodeToCommonFormat(CommonData memory data) internal pure returns (bytes memory encoded) { return abi.encode(data); } function decodeFromCommonFormat(bytes memory request) internal pure returns (CommonData memory data) { return abi.decode(request, (CommonData)); } function manufactureToCommon(bytes memory request) internal pure returns (bytes memory commonData) { return request; } function dataVersion() internal pure returns (uint) { return uint(DataVersion.common); } } /** * //===== EXAMPLE =====// * struct CustomData { * CommonDataFormat.CommonData common; * uint cap; * } * * library CustomDataFormat { * function encodeToCustomFormat(CustomData memory data) internal pure returns (bytes memory encoded) { * return abi.encode(data); * } * * function decodeFromCustomFormat(bytes memory request) internal pure returns (CustomData memory data) { * return abi.decode(request, (CustomData)); * } * * function manufactureCustomToCommon(bytes memory request) internal pure returns (bytes memory customData) { * return abi.encode(decodeFromCustomFormat(request).common); * } * * function manufactureCommonToCustom(bytes memory request) internal pure returns (bytes memory customData) { * CommonData memory common = CommonDataFormat.decodeFromCommonFormat(request); * return abi.encode(CustomData(common, 0)); * } * * function dataVersion() internal pure returns (DataVersion) { * return DataVersion.custom; * } * } * */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); } interface IRiskManager is IERC165Upgradeable { //===== VIEW FUNCTIONS =====// function isRiskedRequest(uint version, bytes memory request) external view returns (bool); function isRiskedRequests(uint version, bytes[] memory requests) external view returns (bool); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } } library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } interface IURC20 is IERC20 { /** * @dev Creates `amount` tokens and assigns them to `account`. * * IMPORTANT: For the use of the Una Bridge, it must be implemented. */ function mint(address to, uint256 amount) external; /** * @dev Destroys the tokens at the address `account` by `amount`. * * IMPORTANT: For the use of the Una Bridge, it must be implemented. */ function burnFrom(address account, uint256 amount) external; } abstract contract RiskGuard is Context { using CommonDataFormat for CommonDataFormat.CommonData; // the contract mananging request risk address immutable public riskManager; constructor(address riskManager_) { require(riskManager_.code.length > 0 && address(riskManager_) != address(0), "RiskGuard: only contract"); riskManager = riskManager_; } /** * @dev Checks for risks associated with a single address before executing the function. * * The caller's address is inherently included in the risk check. * * TIP: It is used when there is only one address related to the function call, excluding the caller. */ modifier nonRisk(bytes4 selector, address account) { if(account != _msgSender()) _isRiskedRequests(selector, _makeArray(account)); else _isRiskedRequest(selector, account); _; } /** * @dev Checks for risks associated with addresses before executing the function. * * The caller's address is inherently included in the risk check. * * TIP: "It is used when there are two addresses related to the function call, excluding the caller * : one for `from` and another for `to`. */ modifier nonRisks(bytes4 selector, address from, address to) { _isRiskedRequests(selector, _makeArray(from, to)); _; } /** * @dev Call `RiskManager` for requests. (false: not exist risk, true: exist risk) * If it exists risk, revert it. * @param selector function signature to detect risk * @param accounts the addresses to inspect for risk */ function _isRiskedRequests(bytes4 selector, address[] memory accounts) internal view { require( !IRiskManager(riskManager).isRiskedRequests( CommonDataFormat.dataVersion(), _getCommonFormatBytes(selector, accounts) ), "RiskGuard: risked request" ); } /** * @dev Call `RiskManager` for a request. (false: not exist risk, true: exist risk) * If it exists risk, revert it. * @param selector function selector to inspect for risk * @param account the address to inspect for risk */ function _isRiskedRequest(bytes4 selector, address account) internal view { require( !IRiskManager(riskManager).isRiskedRequest( CommonDataFormat.dataVersion(), CommonDataFormat.encodeToCommonFormat(CommonDataFormat.CommonData(selector, address(this), account, _msgSender())) ), "RiskGuard: risked request" ); } /** * @dev To enable the `RiskManager` to handle requests for risk assessment * for multiple addresses, it converts them into bytes format. * @param selector function selector to inspect for risk * @param accounts the addresses to inspect for risk * */ function _getCommonFormatBytes( bytes4 selector, address[] memory accounts ) internal view returns(bytes[] memory) { bytes[] memory request = new bytes[](accounts.length); address sender = _msgSender(); for (uint i; i < accounts.length; ) { request[i] = CommonDataFormat.encodeToCommonFormat( CommonDataFormat.CommonData(selector, address(this), accounts[i], sender) ); unchecked{ i++; } } return request; } /** * @dev Creating a data format for the `RiskManager` call. */ function _makeArray ( address from, address to ) internal view returns(address[] memory _addressArray) { _addressArray = new address[](3); _addressArray[0] = _msgSender(); _addressArray[1] = from; _addressArray[2] = to; } /** * @dev Creating a data format for the `RiskManager` call. */ function _makeArray ( address to ) internal view returns(address[] memory _addressArray) { _addressArray = new address[](2); _addressArray[0] = _msgSender(); _addressArray[1] = to; } } contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } library MessageHashUtils { /** * @dev Returns the keccak256 digest of an ERC-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing a bytes32 `messageHash` with * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with * keccak256, although any bytes32 value can be safely used because the final digest will * be re-hashed. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20) } } /** * @dev Returns the keccak256 digest of an ERC-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing an arbitrary `message` with * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) { return keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message)); } /** * @dev Returns the keccak256 digest of an ERC-191 signed data with version * `0x00` (data with intended validator). * * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended * `validator` address. Then hashing the result. * * See {ECDSA-recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked(hex"19_00", validator, data)); } /** * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`). * * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with * `\x19\x01` and hashing the result. It corresponds to the hash signed by the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712. * * See {ECDSA-recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, hex"19_01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) digest := keccak256(ptr, 0x42) } } } interface IERC5267 { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); } type ShortString is bytes32; /** * @dev This library provides functions to convert short memory strings * into a `ShortString` type that can be used as an immutable variable. * * Strings of arbitrary length can be optimized using this library if * they are short enough (up to 31 bytes) by packing them with their * length (1 byte) in a single EVM word (32 bytes). Additionally, a * fallback mechanism can be used for every other case. * * Usage example: * * ```solidity * contract Named { * using ShortStrings for *; * * ShortString private immutable _name; * string private _nameFallback; * * constructor(string memory contractName) { * _name = contractName.toShortStringWithFallback(_nameFallback); * } * * function name() external view returns (string memory) { * return _name.toStringWithFallback(_nameFallback); * } * } * ``` */ library ShortStrings { // Used as an identifier for strings longer than 31 bytes. bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF; error StringTooLong(string str); error InvalidShortString(); /** * @dev Encode a string of at most 31 chars into a `ShortString`. * * This will trigger a `StringTooLong` error is the input string is too long. */ function toShortString(string memory str) internal pure returns (ShortString) { bytes memory bstr = bytes(str); if (bstr.length > 31) { revert StringTooLong(str); } return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length)); } /** * @dev Decode a `ShortString` back to a "normal" string. */ function toString(ShortString sstr) internal pure returns (string memory) { uint256 len = byteLength(sstr); // using `new string(len)` would work locally but is not memory safe. string memory str = new string(32); /// @solidity memory-safe-assembly assembly { mstore(str, len) mstore(add(str, 0x20), sstr) } return str; } /** * @dev Return the length of a `ShortString`. */ function byteLength(ShortString sstr) internal pure returns (uint256) { uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF; if (result > 31) { revert InvalidShortString(); } return result; } /** * @dev Encode a string into a `ShortString`, or write it to storage if it is too long. */ function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) { if (bytes(value).length < 32) { return toShortString(value); } else { StorageSlot.getStringSlot(store).value = value; return ShortString.wrap(FALLBACK_SENTINEL); } } /** * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}. */ function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) { if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { return toString(value); } else { return store; } } /** * @dev Return the length of a string that was encoded to `ShortString` or written to storage using * {setWithFallback}. * * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of * actual characters as the UTF-8 encoding of a single character can span over multiple bytes. */ function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) { if (ShortString.unwrap(value) != FALLBACK_SENTINEL) { return byteLength(value); } else { return bytes(store).length; } } } contract URC20 is IURC20, ERC20, RiskGuard { bytes4 private constant _BURN_SELECTOR = bytes4(keccak256(bytes("_burn(address,uint256)"))); bytes4 private constant _MINT_SELECTOR = bytes4(keccak256(bytes("_mint(address,uint256)"))); /** * @dev Sets the values for {name}, {symbol} and {riskManager}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. */ constructor ( string memory name_, string memory symbol_, address riskManager_ ) RiskGuard(riskManager_) ERC20(name_, symbol_) {} /** * @dev Creates `amount` tokens and assigns them to `account`. * @param to the account to mint * @param amount the amount to mint */ function mint(address to, uint256 amount) public virtual {} /** * @dev The caller destroys the tokens at the address `account` by `amount`. * @param account the account to burn tokens * @param amount the amount to burn */ function burnFrom(address account, uint256 amount) public virtual {} /** * @dev After checking the risks associated with the `to` address, contract address, caller's address, * and the function, tokens are transferred to the `to` address with the `amount`. * @param to the address to receive tokens * @param amount the amount to transfer * */ function transfer( address to, uint256 amount ) public override(ERC20, IERC20) nonRisk(this.transfer.selector, to) returns (bool) { return super.transfer(to, amount); } /** * @dev After checking the risks associated with the `to` address, contract address, caller's address, * and the function, tokens are transferred from the `from` address to the `to` address with the `amount`. * @param to the address to receive tokens * @param from the address to transfer tokens * @param amount the amount to transfer */ function transferFrom( address from, address to, uint256 amount ) public override(ERC20, IERC20) nonRisks(this.transferFrom.selector, from, to) returns (bool) { return super.transferFrom(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing the total supply. * @param account the address to receive minted tokens * @param amount the amount to mint tokens * * NOTE: When creating tokens, it is essential to call this function for risk verification. */ function _mint(address account, uint256 amount) internal override nonRisk(_MINT_SELECTOR, account) { super._mint(account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the total supply. * @param account the address to burn tokens * @param amount the amount to burn tokens * * NOTE: When destorying tokens, it is essential to call this function for risk verification. */ function _burn(address account, uint256 amount) internal override nonRisk(_BURN_SELECTOR, account) { super._burn(account, amount); } } abstract contract Nonces { /** * @dev The nonce used for an `account` is not the expected current nonce. */ error InvalidAccountNonce(address account, uint256 currentNonce); mapping(address => uint256) private _nonces; /** * @dev Returns the next unused nonce for an address. */ function nonces(address owner) public view virtual returns (uint256) { return _nonces[owner]; } /** * @dev Consumes a nonce. * * Returns the current value and increments nonce. */ function _useNonce(address owner) internal virtual returns (uint256) { // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be // decremented or reset. This guarantees that the nonce never overflows. unchecked { // It is important to do x++ and not ++x here. return _nonces[owner]++; } } /** * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`. */ function _useCheckedNonce(address owner, uint256 nonce) internal virtual { uint256 current = _useNonce(owner); if (nonce != current) { revert InvalidAccountNonce(owner, current); } } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } interface IURC20Permit { /** * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens, * given `owner`'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ function DOMAIN_SEPARATOR() external view returns (bytes32); } abstract contract EIP712 is IERC5267 { using ShortStrings for *; bytes32 private constant TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _cachedDomainSeparator; uint256 private immutable _cachedChainId; address private immutable _cachedThis; bytes32 private immutable _hashedName; bytes32 private immutable _hashedVersion; ShortString private immutable _name; ShortString private immutable _version; string private _nameFallback; string private _versionFallback; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { _name = name.toShortStringWithFallback(_nameFallback); _version = version.toShortStringWithFallback(_versionFallback); _hashedName = keccak256(bytes(name)); _hashedVersion = keccak256(bytes(version)); _cachedChainId = block.chainid; _cachedDomainSeparator = _buildDomainSeparator(); _cachedThis = address(this); } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _cachedThis && block.chainid == _cachedChainId) { return _cachedDomainSeparator; } else { return _buildDomainSeparator(); } } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {IERC-5267}. */ function eip712Domain() public view virtual returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { return ( hex"0f", // 01111 _EIP712Name(), _EIP712Version(), block.chainid, address(this), bytes32(0), new uint256[](0) ); } /** * @dev The name parameter for the EIP712 domain. * * NOTE: By default this function reads _name which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). */ // solhint-disable-next-line func-name-mixedcase function _EIP712Name() internal view returns (string memory) { return _name.toStringWithFallback(_nameFallback); } /** * @dev The version parameter for the EIP712 domain. * * NOTE: By default this function reads _version which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). */ // solhint-disable-next-line func-name-mixedcase function _EIP712Version() internal view returns (string memory) { return _version.toStringWithFallback(_versionFallback); } } library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } } abstract contract URC20Permit is URC20, IURC20Permit, EIP712, Nonces { bytes32 private constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the URC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev Allows a token `owner` to sign an approval for a `spender` to spend tokens on their behalf. * @param owner token owner address * @param spender address spending the tokens of `owner` * @param value the amount of tokens to allow for spender * @param deadline the time when the signature expires */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= deadline, "URC20Permit: expired signature"); address signer = ECDSA.recover( _getDigest(owner, spender, value, deadline), v, r, s ); require(signer == owner, "URC20Permit: invalid signer"); _approve(owner, spender, value); } /** * @dev Allows a token `owner` to sign an approval for a `spender` to spend tokens on their behalf. * @param owner token owner address * @param spender address spending the tokens of `owner` * @param value the amount of tokens to allow for spender * @param deadline the time when the signature expires * @param signature token owner signature * * NOTE: This function receives the complete signature as a parameter and extracts `v`, `r`, `s` on-chain. */ function permitWithSignature( address owner, address spender, uint256 value, uint256 deadline, bytes memory signature ) public virtual { require(block.timestamp <= deadline, "URC20Permit: expired signature"); address signer = ECDSA.recover( _getDigest(owner, spender, value, deadline), signature ); require(signer == owner, "URC20Permit: invalid signer"); _approve(owner, spender, value); } /** * @dev Returns the current nonce for `owner`. * @param owner requester address */ function nonces(address owner) public view virtual override(IURC20Permit, Nonces) returns (uint256) { return super.nonces(owner); } /** * @dev Returns the domain separator used in the encoding of the signature for {permit}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view virtual returns (bytes32) { return _domainSeparatorV4(); } /** * @dev Returns the message hash of the content where the token owner approves the spender. * The returned message hash is uniquely generated for each token and chain. * @param owner token owner address * @param spender address spending the tokens of `owner` * @param value the amount of tokens to allow for spender * @param deadline token owner signature */ function getDigest( address owner, address spender, uint256 value, uint256 deadline ) external view returns(bytes32){ return _hashTypedDataV4( keccak256( abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces(owner), deadline ) ) ); } /** * @dev Returns the message hash of the content where the token owner approves the spender. * The returned message hash is uniquely generated for each token and chain. * @param owner token owner address * @param spender address spending the tokens of `owner` * @param value the amount of tokens to allow for spender * @param deadline token owner signature * * NOTE: Increase the user nonce. */ function _getDigest( address owner, address spender, uint256 value, uint256 deadline ) internal returns(bytes32){ return _hashTypedDataV4( keccak256( abi.encode( PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline ) ) ); } } abstract contract URC20Burnable is URC20 { /** * @dev The caller's tokens are destroyed by the `amount`. * @param amount the amount to burn * */ function burn( uint256 amount ) public virtual { _burn(_msgSender(), amount); } /** * @dev The caller, who has an allowance from the `account`, destroys `amount` tokens * from the `account`. * @param account the account to burn tokens * @param amount the amount to burn */ function burnFrom( address account, uint256 amount ) public virtual override { _spendAllowance(account, _msgSender(), amount); _burn(account, amount); } } interface IUnaToken is IURC20 { event ChangeRoleManager(address newRoleManager, address setter); event ChangeRiskManager(address newRiskManager, address setter); function burn(uint256 amount) external; } interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); } contract UnaWEMIX is IUnaToken, URC20Permit, URC20Burnable { using Address for address; // the address of RoleManager contract IAccessControl public roleManager; // the address of UnaStation contract address public unaStation; bytes32 public constant SETTER = "UnaTokenSetter"; bytes32 public constant MINTER = "UnaTokenMinter"; bytes32 public constant BURNER = "UnaTokenBurner"; modifier checkRole(bytes32 role) { require(roleManager.hasRole(role, msg.sender), "UnaToken: permission denied"); _; } constructor( string memory name, string memory symbol, address riskManager, IAccessControl _roleManager ) URC20Permit(name) URC20(name, symbol, riskManager) { require( address(_roleManager).isContract() && address(_roleManager) != address(0), "UnaToken: only contract" ); roleManager = _roleManager; } /** * @dev Mint Una token. The Una token can only be minted by addresses * with either the UnaStation or MINTER authority. * @param to the address to receive tokens * @param amount the amount to mint * * See {URC20-_mint}. */ function mint( address to, uint256 amount ) public override(IURC20, URC20) checkRole(MINTER) { _mint(to, amount); } /** * @dev The Una token can only be burned by addresses * with either the UnaStation or BURNER authority. * @param amount the amount to burn * * See {URC20-_burn}. */ function burn( uint256 amount ) public override(IUnaToken, URC20Burnable) checkRole(BURNER) { super.burn(amount); } /** * @dev An address with BURNER authority burns the Una Token held in the `account`. * @param amount the amount to burn * * See {URC20-_burn} and {URC20-allowance}. */ function burnFrom( address account, uint256 amount ) public override(IURC20, URC20, URC20Burnable) checkRole(BURNER) { super.burnFrom(account, amount); } /** * @dev Change RoleManger. * @param _roleManager the address of the new RoleManager contract */ function changeRoleManager(IAccessControl _roleManager) external checkRole(SETTER) { require( address(_roleManager).isContract() && address(_roleManager) != address(0), "UnaToken: only CA" ); roleManager = _roleManager; emit ChangeRoleManager(address(_roleManager), msg.sender); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"riskManager","type":"address"},{"internalType":"contract IAccessControl","name":"_roleManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRiskManager","type":"address"},{"indexed":false,"internalType":"address","name":"setter","type":"address"}],"name":"ChangeRiskManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRoleManager","type":"address"},{"indexed":false,"internalType":"address","name":"setter","type":"address"}],"name":"ChangeRoleManager","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BURNER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAccessControl","name":"_roleManager","type":"address"}],"name":"changeRoleManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"getDigest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permitWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"riskManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roleManager","outputs":[{"internalType":"contract IAccessControl","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unaStation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101806040523480156200001257600080fd5b5060405162002a9538038062002a958339810160408190526200003591620004cd565b8380604051806040016040528060018152602001603160f81b81525086868680838381600390805190602001906200006f92919062000334565b5080516200008590600490602084019062000334565b5050506000816001600160a01b03163b118015620000ab57506001600160a01b03811615155b620000fd5760405162461bcd60e51b815260206004820152601860248201527f5269736b47756172643a206f6e6c7920636f6e7472616374000000000000000060448201526064015b60405180910390fd5b6001600160a01b03166080525062000127915083905060056200028b602090811b62000c3617901c565b61014052620001448160066200028b602090811b62000c3617901c565b61016052815160208084019190912061010052815190820120610120524660c052620001d46101005161012051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60a05250503060e05250620001fe6001600160a01b038216620002df602090811b62000c6d17901c565b80156200021357506001600160a01b03811615155b620002615760405162461bcd60e51b815260206004820152601760248201527f556e61546f6b656e3a206f6e6c7920636f6e74726163740000000000000000006044820152606401620000f4565b600880546001600160a01b0319166001600160a01b039290921691909117905550620005f5915050565b6000602083511015620002ab57620002a383620002ee565b9050620002d9565b82620002c2836200033160201b62000c7c1760201c565b8151620002d3926020019062000334565b5060ff90505b92915050565b6001600160a01b03163b151590565b600080829050601f815111156200031c578260405163305a27a960e01b8152600401620000f4919062000561565b8051620003298262000596565b179392505050565b90565b8280546200034290620005be565b90600052602060002090601f016020900481019282620003665760008555620003b1565b82601f106200038157805160ff1916838001178555620003b1565b82800160010185558215620003b1579182015b82811115620003b157825182559160200191906001019062000394565b50620003bf929150620003c3565b5090565b5b80821115620003bf5760008155600101620003c4565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200040d578181015183820152602001620003f3565b838111156200041d576000848401525b50505050565b600082601f8301126200043557600080fd5b81516001600160401b0380821115620004525762000452620003da565b604051601f8301601f19908116603f011681019082821181831017156200047d576200047d620003da565b816040528381528660208588010111156200049757600080fd5b620004aa846020830160208901620003f0565b9695505050505050565b6001600160a01b0381168114620004ca57600080fd5b50565b60008060008060808587031215620004e457600080fd5b84516001600160401b0380821115620004fc57600080fd5b6200050a8883890162000423565b955060208701519150808211156200052157600080fd5b50620005308782880162000423565b93505060408501516200054381620004b4565b60608601519092506200055681620004b4565b939692955090935050565b602081526000825180602084015262000582816040850160208701620003f0565b601f01601f19169190910160400192915050565b80516020808301519190811015620005b8576000198160200360031b1b821691505b50919050565b600181811c90821680620005d357607f821691505b60208210811415620005b857634e487b7160e01b600052602260045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161242c62000669600039600061117301526000611146015260006110400152600061101801526000610f7301526000610f9d01526000610fc70152600081816102c001528181610e710152611230015261242c6000f3fe608060405234801561001057600080fd5b50600436106101a85760003560e01c80634cf409d0116100f9578063a9059cbb11610097578063d505accf11610071578063d505accf146103b8578063dd62ed3e146103cb578063f363217e146103de578063fe6d8124146103f157600080fd5b8063a9059cbb1461037f578063bba76a0514610392578063c39a717a146103a557600080fd5b80637ecebe00116100d35780637ecebe001461033657806384b0196e1461034957806395d89b4114610364578063a457c2d71461036c57600080fd5b80634cf409d0146102e257806370a08231146102fa57806379cc67901461032357600080fd5b8063313ce567116101665780633f849d72116101405780633f849d721461028057806340c10f191461029357806342966c68146102a857806347842663146102bb57600080fd5b8063313ce567146102565780633644e51514610265578063395093511461026d57600080fd5b8062435da5146101ad57806306fdde03146101dd578063095ea7b3146101f2578063118c4f131461021557806318160ddd1461023b57806323b872dd14610243575b600080fd5b6008546101c0906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101e5610409565b6040516101d49190611f03565b610205610200366004611f32565b61049b565b60405190151581526020016101d4565b61022d6d2ab730aa37b5b2b7213ab93732b960911b81565b6040519081526020016101d4565b60025461022d565b610205610251366004611f5e565b6104b5565b604051601281526020016101d4565b61022d6104ea565b61020561027b366004611f32565b6104f9565b6009546101c0906001600160a01b031681565b6102a66102a1366004611f32565b61051b565b005b6102a66102b6366004611f9f565b6105d3565b6101c07f000000000000000000000000000000000000000000000000000000000000000081565b61022d6d2ab730aa37b5b2b729b2ba3a32b960911b81565b61022d610308366004611fb8565b6001600160a01b031660009081526020819052604090205490565b6102a6610331366004611f32565b610680565b61022d610344366004611fb8565b61072a565b610351610748565b6040516101d49796959493929190611fd5565b6101e561078e565b61020561037a366004611f32565b61079d565b61020561038d366004611f32565b610823565b61022d6103a036600461206b565b61086d565b6102a66103b33660046120c7565b6108f2565b6102a66103c63660046121b1565b6109cf565b61022d6103d9366004612228565b610ab0565b6102a66103ec366004611fb8565b610adb565b61022d6d2ab730aa37b5b2b726b4b73a32b960911b81565b60606003805461041890612261565b80601f016020809104026020016040519081016040528092919081815260200182805461044490612261565b80156104915780601f1061046657610100808354040283529160200191610491565b820191906000526020600020905b81548152906001019060200180831161047457829003601f168201915b5050505050905090565b6000336104a9818585610c7f565b60019150505b92915050565b60006323b872dd60e01b84846104d4836104cf8484610da3565b610e67565b6104df878787610f4d565b979650505050505050565b60006104f4610f66565b905090565b6000336104a981858561050c8383610ab0565b610516919061229c565b610c7f565b600854604051632474521560e21b81526d2ab730aa37b5b2b726b4b73a32b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa15801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f91906122c2565b6105c45760405162461bcd60e51b81526004016105bb906122e4565b60405180910390fd5b6105ce8383611091565b505050565b600854604051632474521560e21b81526d2ab730aa37b5b2b7213ab93732b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa158015610633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065791906122c2565b6106735760405162461bcd60e51b81526004016105bb906122e4565b61067c8261111d565b5050565b600854604051632474521560e21b81526d2ab730aa37b5b2b7213ab93732b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa1580156106e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070491906122c2565b6107205760405162461bcd60e51b81526004016105bb906122e4565b6105ce838361112a565b6001600160a01b0381166000908152600760205260408120546104af565b60006060806000806000606061075c61113f565b61076461116c565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60606004805461041890612261565b600033816107ab8286610ab0565b90508381101561080b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105bb565b6108188286868403610c7f565b506001949350505050565b600063a9059cbb60e01b836001600160a01b03811633146108505761084b826104cf83611199565b61085a565b61085a8282611226565b61086485856112c7565b95945050505050565b60006108647f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c986868661089f8a61072a565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810184905260e001604051602081830303815290604052805190602001206112d5565b814211156109425760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105bb565b600061095961095387878787611302565b83611352565b9050856001600160a01b0316816001600160a01b0316146109bc5760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105bb565b6109c7868686610c7f565b505050505050565b83421115610a1f5760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105bb565b6000610a38610a3089898989611302565b858585611376565b9050876001600160a01b0316816001600160a01b031614610a9b5760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105bb565b610aa6888888610c7f565b5050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600854604051632474521560e21b81526d2ab730aa37b5b2b729b2ba3a32b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa158015610b3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5f91906122c2565b610b7b5760405162461bcd60e51b81526004016105bb906122e4565b6001600160a01b0382163b15158015610b9c57506001600160a01b03821615155b610bdc5760405162461bcd60e51b8152602060048201526011602482015270556e61546f6b656e3a206f6e6c7920434160781b60448201526064016105bb565b600880546001600160a01b0319166001600160a01b038416908117909155604080519182523360208301527f6a286ad733a236a0f265e87f33e6a3d047963fb13cfae230a295adafc4e430de910160405180910390a15050565b6000602083511015610c5257610c4b8361139e565b90506104af565b82828151610c639260200190611e1d565b5060ff90506104af565b6001600160a01b03163b151590565b90565b6001600160a01b038316610ce15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bb565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b604080516003808252608082019092526060916020820183803683370190505090503381600081518110610dd957610dd961231b565b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110610e0d57610e0d61231b565b60200260200101906001600160a01b031690816001600160a01b0316815250508181600281518110610e4157610e4161231b565b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663afa960e36001610ea285856113dc565b6040518363ffffffff1660e01b8152600401610ebf929190612331565b602060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0091906122c2565b1561067c5760405162461bcd60e51b815260206004820152601960248201527f5269736b47756172643a207269736b656420726571756573740000000000000060448201526064016105bb565b600033610f5b8582856114d3565b610818858585611547565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610fbf57507f000000000000000000000000000000000000000000000000000000000000000046145b15610fe957507f000000000000000000000000000000000000000000000000000000000000000090565b6104f4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6040805180820190915260168152755f6d696e7428616464726573732c75696e743235362960501b6020909101527f4e6ec2477b215d44bbbdd0f5815b8827188f1eb827c01cc00f7f983582322afa826001600160a01b0381163314611103576110fe826104cf83611199565b61110d565b61110d8282611226565b61111784846116eb565b50505050565b61112733826117aa565b50565b6111358233836114d3565b61067c82826117aa565b60606104f47f00000000000000000000000000000000000000000000000000000000000000006005611830565b60606104f47f00000000000000000000000000000000000000000000000000000000000000006006611830565b604080516002808252606080830184529260208301908036833701905050905033816000815181106111cd576111cd61231b565b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106112015761120161231b565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663d37c475160016112aa6040518060800160405280876001600160e01b0319168152602001306001600160a01b03168152602001866001600160a01b0316815260200161129a3390565b6001600160a01b031690526118d4565b6040518363ffffffff1660e01b8152600401610ebf92919061239b565b6000336104a9818585611547565b60006104af6112e2610f66565b8360405161190160f01b8152600281019290925260228201526042902090565b60006108647f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c986868661089f8a6001600160a01b0316600090815260076020526040902080546001810190915590565b60008060006113618585611933565b9150915061136e816119a3565b509392505050565b600080600061138787878787611b5e565b91509150611394816119a3565b5095945050505050565b600080829050601f815111156113c9578260405163305a27a960e01b81526004016105bb9190611f03565b80516113d4826123bc565b179392505050565b60606000825167ffffffffffffffff8111156113fa576113fa6120b1565b60405190808252806020026020018201604052801561142d57816020015b60608152602001906001900390816114185790505b5090503360005b84518110156114c9576114a46040518060800160405280886001600160e01b0319168152602001306001600160a01b0316815260200187848151811061147c5761147c61231b565b60200260200101516001600160a01b03168152602001846001600160a01b03168152506118d4565b8382815181106114b6576114b661231b565b6020908102919091010152600101611434565b5090949350505050565b60006114df8484610ab0565b90506000198114611117578181101561153a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105bb565b6111178484848403610c7f565b6001600160a01b0383166115ab5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bb565b6001600160a01b03821661160d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bb565b6001600160a01b038316600090815260208190526040902054818110156116855760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105bb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611117565b6001600160a01b0382166117415760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105bb565b8060026000828254611753919061229c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040805180820190915260168152755f6275726e28616464726573732c75696e743235362960501b6020909101527f6161eb1814eb615e35a7abf22bf65277ce47a5a31644b90c2ab4d1570410a1e8826001600160a01b038116331461181c57611817826104cf83611199565b611826565b6118268282611226565b6111178484611c4b565b606060ff831461184357610c4b83611d7d565b81805461184f90612261565b80601f016020809104026020016040519081016040528092919081815260200182805461187b90612261565b80156118c85780601f1061189d576101008083540402835291602001916118c8565b820191906000526020600020905b8154815290600101906020018083116118ab57829003601f168201915b505050505090506104af565b6040805182516001600160e01b0319166020808301919091528301516001600160a01b039081168284015291830151821660608281019190915283810151909216608082015260a0016040516020818303038152906040529050919050565b60008082516041141561196a5760208301516040840151606085015160001a61195e87828585611b5e565b9450945050505061199c565b8251604014156119945760208301516040840151611989868383611dbc565b93509350505061199c565b506000905060025b9250929050565b60008160048111156119b7576119b76123e0565b14156119c05750565b60018160048111156119d4576119d46123e0565b1415611a225760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105bb565b6002816004811115611a3657611a366123e0565b1415611a845760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105bb565b6003816004811115611a9857611a986123e0565b1415611af15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105bb565b6004816004811115611b0557611b056123e0565b14156111275760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105bb565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b955750600090506003611c42565b8460ff16601b14158015611bad57508460ff16601c14155b15611bbe5750600090506004611c42565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611c12573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c3b57600060019250925050611c42565b9150600090505b94509492505050565b6001600160a01b038216611cab5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105bb565b6001600160a01b03821660009081526020819052604090205481811015611d1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105bb565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60606000611d8a83611df5565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806001600160ff1b03831681611dd960ff86901c601b61229c565b9050611de787828885611b5e565b935093505050935093915050565b600060ff8216601f8111156104af57604051632cd44ac360e21b815260040160405180910390fd5b828054611e2990612261565b90600052602060002090601f016020900481019282611e4b5760008555611e91565b82601f10611e6457805160ff1916838001178555611e91565b82800160010185558215611e91579182015b82811115611e91578251825591602001919060010190611e76565b50611e9d929150611ea1565b5090565b5b80821115611e9d5760008155600101611ea2565b6000815180845260005b81811015611edc57602081850181015186830182015201611ec0565b81811115611eee576000602083870101525b50601f01601f19169290920160200192915050565b602081526000611f166020830184611eb6565b9392505050565b6001600160a01b038116811461112757600080fd5b60008060408385031215611f4557600080fd5b8235611f5081611f1d565b946020939093013593505050565b600080600060608486031215611f7357600080fd5b8335611f7e81611f1d565b92506020840135611f8e81611f1d565b929592945050506040919091013590565b600060208284031215611fb157600080fd5b5035919050565b600060208284031215611fca57600080fd5b8135611f1681611f1d565b60ff60f81b881681526000602060e081840152611ff560e084018a611eb6565b8381036040850152612007818a611eb6565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120595783518352928401929184019160010161203d565b50909c9b505050505050505050505050565b6000806000806080858703121561208157600080fd5b843561208c81611f1d565b9350602085013561209c81611f1d565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156120df57600080fd5b85356120ea81611f1d565b945060208601356120fa81611f1d565b93506040860135925060608601359150608086013567ffffffffffffffff8082111561212557600080fd5b818801915088601f83011261213957600080fd5b81358181111561214b5761214b6120b1565b604051601f8201601f19908116603f01168101908382118183101715612173576121736120b1565b816040528281528b602084870101111561218c57600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b600080600080600080600060e0888a0312156121cc57600080fd5b87356121d781611f1d565b965060208801356121e781611f1d565b95506040880135945060608801359350608088013560ff8116811461220b57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561223b57600080fd5b823561224681611f1d565b9150602083013561225681611f1d565b809150509250929050565b600181811c9082168061227557607f821691505b6020821081141561229657634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156122bd57634e487b7160e01b600052601160045260246000fd5b500190565b6000602082840312156122d457600080fd5b81518015158114611f1657600080fd5b6020808252601b908201527f556e61546f6b656e3a207065726d697373696f6e2064656e6965640000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b8281101561238d57605f1988870301845261237b868351611eb6565b9550928401929084019060010161235f565b509398975050505050505050565b8281526040602082015260006123b46040830184611eb6565b949350505050565b805160208083015191908110156122965760001960209190910360031b1b16919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ee90cba717d263ccdfea4abcb228d141b8935ee32dcc8609df798da86b7671d564736f6c634300080a0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e0000000000000000000000009ff1d43eba6cb699ad56040867abe55acb49c9520000000000000000000000000000000000000000000000000000000000000009756e612057454d495800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009756e612e57454d49580000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a85760003560e01c80634cf409d0116100f9578063a9059cbb11610097578063d505accf11610071578063d505accf146103b8578063dd62ed3e146103cb578063f363217e146103de578063fe6d8124146103f157600080fd5b8063a9059cbb1461037f578063bba76a0514610392578063c39a717a146103a557600080fd5b80637ecebe00116100d35780637ecebe001461033657806384b0196e1461034957806395d89b4114610364578063a457c2d71461036c57600080fd5b80634cf409d0146102e257806370a08231146102fa57806379cc67901461032357600080fd5b8063313ce567116101665780633f849d72116101405780633f849d721461028057806340c10f191461029357806342966c68146102a857806347842663146102bb57600080fd5b8063313ce567146102565780633644e51514610265578063395093511461026d57600080fd5b8062435da5146101ad57806306fdde03146101dd578063095ea7b3146101f2578063118c4f131461021557806318160ddd1461023b57806323b872dd14610243575b600080fd5b6008546101c0906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101e5610409565b6040516101d49190611f03565b610205610200366004611f32565b61049b565b60405190151581526020016101d4565b61022d6d2ab730aa37b5b2b7213ab93732b960911b81565b6040519081526020016101d4565b60025461022d565b610205610251366004611f5e565b6104b5565b604051601281526020016101d4565b61022d6104ea565b61020561027b366004611f32565b6104f9565b6009546101c0906001600160a01b031681565b6102a66102a1366004611f32565b61051b565b005b6102a66102b6366004611f9f565b6105d3565b6101c07f000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e81565b61022d6d2ab730aa37b5b2b729b2ba3a32b960911b81565b61022d610308366004611fb8565b6001600160a01b031660009081526020819052604090205490565b6102a6610331366004611f32565b610680565b61022d610344366004611fb8565b61072a565b610351610748565b6040516101d49796959493929190611fd5565b6101e561078e565b61020561037a366004611f32565b61079d565b61020561038d366004611f32565b610823565b61022d6103a036600461206b565b61086d565b6102a66103b33660046120c7565b6108f2565b6102a66103c63660046121b1565b6109cf565b61022d6103d9366004612228565b610ab0565b6102a66103ec366004611fb8565b610adb565b61022d6d2ab730aa37b5b2b726b4b73a32b960911b81565b60606003805461041890612261565b80601f016020809104026020016040519081016040528092919081815260200182805461044490612261565b80156104915780601f1061046657610100808354040283529160200191610491565b820191906000526020600020905b81548152906001019060200180831161047457829003601f168201915b5050505050905090565b6000336104a9818585610c7f565b60019150505b92915050565b60006323b872dd60e01b84846104d4836104cf8484610da3565b610e67565b6104df878787610f4d565b979650505050505050565b60006104f4610f66565b905090565b6000336104a981858561050c8383610ab0565b610516919061229c565b610c7f565b600854604051632474521560e21b81526d2ab730aa37b5b2b726b4b73a32b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa15801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f91906122c2565b6105c45760405162461bcd60e51b81526004016105bb906122e4565b60405180910390fd5b6105ce8383611091565b505050565b600854604051632474521560e21b81526d2ab730aa37b5b2b7213ab93732b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa158015610633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065791906122c2565b6106735760405162461bcd60e51b81526004016105bb906122e4565b61067c8261111d565b5050565b600854604051632474521560e21b81526d2ab730aa37b5b2b7213ab93732b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa1580156106e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070491906122c2565b6107205760405162461bcd60e51b81526004016105bb906122e4565b6105ce838361112a565b6001600160a01b0381166000908152600760205260408120546104af565b60006060806000806000606061075c61113f565b61076461116c565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60606004805461041890612261565b600033816107ab8286610ab0565b90508381101561080b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105bb565b6108188286868403610c7f565b506001949350505050565b600063a9059cbb60e01b836001600160a01b03811633146108505761084b826104cf83611199565b61085a565b61085a8282611226565b61086485856112c7565b95945050505050565b60006108647f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c986868661089f8a61072a565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810184905260e001604051602081830303815290604052805190602001206112d5565b814211156109425760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105bb565b600061095961095387878787611302565b83611352565b9050856001600160a01b0316816001600160a01b0316146109bc5760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105bb565b6109c7868686610c7f565b505050505050565b83421115610a1f5760405162461bcd60e51b815260206004820152601e60248201527f55524332305065726d69743a2065787069726564207369676e6174757265000060448201526064016105bb565b6000610a38610a3089898989611302565b858585611376565b9050876001600160a01b0316816001600160a01b031614610a9b5760405162461bcd60e51b815260206004820152601b60248201527f55524332305065726d69743a20696e76616c6964207369676e6572000000000060448201526064016105bb565b610aa6888888610c7f565b5050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600854604051632474521560e21b81526d2ab730aa37b5b2b729b2ba3a32b960911b60048201819052336024830152916001600160a01b0316906391d1485490604401602060405180830381865afa158015610b3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5f91906122c2565b610b7b5760405162461bcd60e51b81526004016105bb906122e4565b6001600160a01b0382163b15158015610b9c57506001600160a01b03821615155b610bdc5760405162461bcd60e51b8152602060048201526011602482015270556e61546f6b656e3a206f6e6c7920434160781b60448201526064016105bb565b600880546001600160a01b0319166001600160a01b038416908117909155604080519182523360208301527f6a286ad733a236a0f265e87f33e6a3d047963fb13cfae230a295adafc4e430de910160405180910390a15050565b6000602083511015610c5257610c4b8361139e565b90506104af565b82828151610c639260200190611e1d565b5060ff90506104af565b6001600160a01b03163b151590565b90565b6001600160a01b038316610ce15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bb565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b604080516003808252608082019092526060916020820183803683370190505090503381600081518110610dd957610dd961231b565b60200260200101906001600160a01b031690816001600160a01b0316815250508281600181518110610e0d57610e0d61231b565b60200260200101906001600160a01b031690816001600160a01b0316815250508181600281518110610e4157610e4161231b565b60200260200101906001600160a01b031690816001600160a01b03168152505092915050565b6001600160a01b037f000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e1663afa960e36001610ea285856113dc565b6040518363ffffffff1660e01b8152600401610ebf929190612331565b602060405180830381865afa158015610edc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0091906122c2565b1561067c5760405162461bcd60e51b815260206004820152601960248201527f5269736b47756172643a207269736b656420726571756573740000000000000060448201526064016105bb565b600033610f5b8582856114d3565b610818858585611547565b6000306001600160a01b037f0000000000000000000000002624bd0094f474713ac9c634b37a5ebef4e0b1fe16148015610fbf57507f000000000000000000000000000000000000000000000000000000000000000146145b15610fe957507f331c8e60e4aea8ea0871427fb667bc4644a2735ba6e5eb4f7193d48aa7a1c10090565b6104f4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f664d130af38e9ae16fe283d8735bba628c3d6d65ead55928cd6cfca6626ffdd4918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6040805180820190915260168152755f6d696e7428616464726573732c75696e743235362960501b6020909101527f4e6ec2477b215d44bbbdd0f5815b8827188f1eb827c01cc00f7f983582322afa826001600160a01b0381163314611103576110fe826104cf83611199565b61110d565b61110d8282611226565b61111784846116eb565b50505050565b61112733826117aa565b50565b6111358233836114d3565b61067c82826117aa565b60606104f47f756e612057454d495800000000000000000000000000000000000000000000096005611830565b60606104f47f31000000000000000000000000000000000000000000000000000000000000016006611830565b604080516002808252606080830184529260208301908036833701905050905033816000815181106111cd576111cd61231b565b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106112015761120161231b565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6001600160a01b037f000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e1663d37c475160016112aa6040518060800160405280876001600160e01b0319168152602001306001600160a01b03168152602001866001600160a01b0316815260200161129a3390565b6001600160a01b031690526118d4565b6040518363ffffffff1660e01b8152600401610ebf92919061239b565b6000336104a9818585611547565b60006104af6112e2610f66565b8360405161190160f01b8152600281019290925260228201526042902090565b60006108647f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c986868661089f8a6001600160a01b0316600090815260076020526040902080546001810190915590565b60008060006113618585611933565b9150915061136e816119a3565b509392505050565b600080600061138787878787611b5e565b91509150611394816119a3565b5095945050505050565b600080829050601f815111156113c9578260405163305a27a960e01b81526004016105bb9190611f03565b80516113d4826123bc565b179392505050565b60606000825167ffffffffffffffff8111156113fa576113fa6120b1565b60405190808252806020026020018201604052801561142d57816020015b60608152602001906001900390816114185790505b5090503360005b84518110156114c9576114a46040518060800160405280886001600160e01b0319168152602001306001600160a01b0316815260200187848151811061147c5761147c61231b565b60200260200101516001600160a01b03168152602001846001600160a01b03168152506118d4565b8382815181106114b6576114b661231b565b6020908102919091010152600101611434565b5090949350505050565b60006114df8484610ab0565b90506000198114611117578181101561153a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105bb565b6111178484848403610c7f565b6001600160a01b0383166115ab5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bb565b6001600160a01b03821661160d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bb565b6001600160a01b038316600090815260208190526040902054818110156116855760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105bb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611117565b6001600160a01b0382166117415760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105bb565b8060026000828254611753919061229c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040805180820190915260168152755f6275726e28616464726573732c75696e743235362960501b6020909101527f6161eb1814eb615e35a7abf22bf65277ce47a5a31644b90c2ab4d1570410a1e8826001600160a01b038116331461181c57611817826104cf83611199565b611826565b6118268282611226565b6111178484611c4b565b606060ff831461184357610c4b83611d7d565b81805461184f90612261565b80601f016020809104026020016040519081016040528092919081815260200182805461187b90612261565b80156118c85780601f1061189d576101008083540402835291602001916118c8565b820191906000526020600020905b8154815290600101906020018083116118ab57829003601f168201915b505050505090506104af565b6040805182516001600160e01b0319166020808301919091528301516001600160a01b039081168284015291830151821660608281019190915283810151909216608082015260a0016040516020818303038152906040529050919050565b60008082516041141561196a5760208301516040840151606085015160001a61195e87828585611b5e565b9450945050505061199c565b8251604014156119945760208301516040840151611989868383611dbc565b93509350505061199c565b506000905060025b9250929050565b60008160048111156119b7576119b76123e0565b14156119c05750565b60018160048111156119d4576119d46123e0565b1415611a225760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105bb565b6002816004811115611a3657611a366123e0565b1415611a845760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105bb565b6003816004811115611a9857611a986123e0565b1415611af15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105bb565b6004816004811115611b0557611b056123e0565b14156111275760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105bb565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b955750600090506003611c42565b8460ff16601b14158015611bad57508460ff16601c14155b15611bbe5750600090506004611c42565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611c12573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611c3b57600060019250925050611c42565b9150600090505b94509492505050565b6001600160a01b038216611cab5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105bb565b6001600160a01b03821660009081526020819052604090205481811015611d1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105bb565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b60606000611d8a83611df5565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806001600160ff1b03831681611dd960ff86901c601b61229c565b9050611de787828885611b5e565b935093505050935093915050565b600060ff8216601f8111156104af57604051632cd44ac360e21b815260040160405180910390fd5b828054611e2990612261565b90600052602060002090601f016020900481019282611e4b5760008555611e91565b82601f10611e6457805160ff1916838001178555611e91565b82800160010185558215611e91579182015b82811115611e91578251825591602001919060010190611e76565b50611e9d929150611ea1565b5090565b5b80821115611e9d5760008155600101611ea2565b6000815180845260005b81811015611edc57602081850181015186830182015201611ec0565b81811115611eee576000602083870101525b50601f01601f19169290920160200192915050565b602081526000611f166020830184611eb6565b9392505050565b6001600160a01b038116811461112757600080fd5b60008060408385031215611f4557600080fd5b8235611f5081611f1d565b946020939093013593505050565b600080600060608486031215611f7357600080fd5b8335611f7e81611f1d565b92506020840135611f8e81611f1d565b929592945050506040919091013590565b600060208284031215611fb157600080fd5b5035919050565b600060208284031215611fca57600080fd5b8135611f1681611f1d565b60ff60f81b881681526000602060e081840152611ff560e084018a611eb6565b8381036040850152612007818a611eb6565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b818110156120595783518352928401929184019160010161203d565b50909c9b505050505050505050505050565b6000806000806080858703121561208157600080fd5b843561208c81611f1d565b9350602085013561209c81611f1d565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156120df57600080fd5b85356120ea81611f1d565b945060208601356120fa81611f1d565b93506040860135925060608601359150608086013567ffffffffffffffff8082111561212557600080fd5b818801915088601f83011261213957600080fd5b81358181111561214b5761214b6120b1565b604051601f8201601f19908116603f01168101908382118183101715612173576121736120b1565b816040528281528b602084870101111561218c57600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b600080600080600080600060e0888a0312156121cc57600080fd5b87356121d781611f1d565b965060208801356121e781611f1d565b95506040880135945060608801359350608088013560ff8116811461220b57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561223b57600080fd5b823561224681611f1d565b9150602083013561225681611f1d565b809150509250929050565b600181811c9082168061227557607f821691505b6020821081141561229657634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156122bd57634e487b7160e01b600052601160045260246000fd5b500190565b6000602082840312156122d457600080fd5b81518015158114611f1657600080fd5b6020808252601b908201527f556e61546f6b656e3a207065726d697373696f6e2064656e6965640000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b8281101561238d57605f1988870301845261237b868351611eb6565b9550928401929084019060010161235f565b509398975050505050505050565b8281526040602082015260006123b46040830184611eb6565b949350505050565b805160208083015191908110156122965760001960209190910360031b1b16919050565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ee90cba717d263ccdfea4abcb228d141b8935ee32dcc8609df798da86b7671d564736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e0000000000000000000000009ff1d43eba6cb699ad56040867abe55acb49c9520000000000000000000000000000000000000000000000000000000000000009756e612057454d495800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009756e612e57454d49580000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): una WEMIX
Arg [1] : symbol (string): una.WEMIX
Arg [2] : riskManager (address): 0xe9f63Ed0a269CA9351dAFa26d03C3b69003f641E
Arg [3] : _roleManager (address): 0x9FF1D43eBa6Cb699ad56040867Abe55aCb49C952
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 000000000000000000000000e9f63ed0a269ca9351dafa26d03c3b69003f641e
Arg [3] : 0000000000000000000000009ff1d43eba6cb699ad56040867abe55acb49c952
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [5] : 756e612057454d49580000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [7] : 756e612e57454d49580000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.