Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 11 from a total of 11 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap Exact Token... | 20849719 | 117 days ago | IN | 0.006 ETH | 0.00152404 | ||||
Swap Exact Token... | 20849518 | 117 days ago | IN | 0.006 ETH | 0.00143277 | ||||
Swap Exact Token... | 20849503 | 117 days ago | IN | 0.006 ETH | 0.00153246 | ||||
Swap Exact ETH F... | 20849471 | 117 days ago | IN | 0.106 ETH | 0.00164466 | ||||
Swap Exact ETH F... | 20849446 | 117 days ago | IN | 0.036 ETH | 0.00152862 | ||||
Set Launched | 20849406 | 117 days ago | IN | 0 ETH | 0.00023099 | ||||
Swap Exact ETH F... | 20849406 | 117 days ago | IN | 0.026 ETH | 0.00179627 | ||||
Swap Exact ETH F... | 20849402 | 117 days ago | IN | 0.026 ETH | 0.00180368 | ||||
Swap Exact ETH F... | 20849399 | 117 days ago | IN | 0.026 ETH | 0.00183672 | ||||
Swap Exact ETH F... | 20849396 | 117 days ago | IN | 0.026 ETH | 0.0018626 | ||||
Swap Exact ETH F... | 20849389 | 117 days ago | IN | 0.026 ETH | 0.00188663 |
Latest 17 internal transactions
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
20849720 | 117 days ago | 0.03772074 ETH | ||||
20849720 | 117 days ago | 0.03772074 ETH | ||||
20849719 | 117 days ago | 0.006 ETH | ||||
20849519 | 117 days ago | 0.01570306 ETH | ||||
20849519 | 117 days ago | 0.01570306 ETH | ||||
20849518 | 117 days ago | 0.006 ETH | ||||
20849504 | 117 days ago | 0.05253134 ETH | ||||
20849504 | 117 days ago | 0.05253134 ETH | ||||
20849503 | 117 days ago | 0.006 ETH | ||||
20849471 | 117 days ago | 0.106 ETH | ||||
20849446 | 117 days ago | 0.036 ETH | ||||
20849406 | 117 days ago | 0.026 ETH | ||||
20849402 | 117 days ago | 0.026 ETH | ||||
20849399 | 117 days ago | 0.026 ETH | ||||
20849396 | 117 days ago | 0.026 ETH | ||||
20849389 | 117 days ago | 0.026 ETH | ||||
20849294 | 117 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdE368451...A34408520 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SlaveTokenProduct
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {LikwidProduct} from "./LikwidProduct.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {ActionType} from "../constants/ActionType.sol"; import {IFactorySlave} from "../interface/IFactorySlave.sol"; import {IChannelSlave} from "../interface/IChannelSlave.sol"; contract SlaveTokenProduct is LikwidProduct { IFactorySlave public _factory; address public signer; uint public launchLimit; uint8 public launchCreatorTime = 20; constructor( string memory _name, string memory _symbol, address _ownerAddr, address _factoryAddress, uint _omniSupply, uint _launchFunds, uint _launchTime, uint _launchHardCap, address _creatorAddr, address _signer, bytes memory params ) LikwidProduct( _name, _symbol, _ownerAddr, _factoryAddress, _omniSupply, _launchFunds, _launchTime, _launchHardCap, _creatorAddr ) { signer = _signer; _factory = IFactorySlave(_factoryAddress); if (params.length > 0) { (, , launchLimit, signSwitch) = abi.decode(params, (uint, uint, uint, bool)); } } mapping(address => uint) public depositPing; mapping(address => uint) public buyNonce; mapping(address => mapping(uint => bool)) public buyNoncePong; mapping(address => uint) public sellNonce; mapping(address => mapping(uint => bool)) public sellNoncePong; function setSigner(address addr_) external onlyOwner { signer = addr_; } function setLaunched(bool _launched) external { require(signer == _msgSender() || owner() == _msgSender(), "only signer/owner call"); launched = _launched; } function setLaunchCreatorTime(uint8 _launchCreatorTime) external onlyOwner { launchCreatorTime = _launchCreatorTime; } function depositTotal(address sender) public view returns (uint) { uint amount; if (sender == creatorAddr) { amount = launchLimit * launchCreatorTime; } else { amount = launchLimit; } if (amount == 0) { amount = launchFunds / 100; } if (amount > launchFunds) { amount = launchFunds; } return amount; } function action_func( bytes32, uint64 srcChainId, address sender, uint8 action, uint, bytes memory params ) internal override { if (action == uint8(ActionType.buyPong)) { (uint nonce, address target, uint native, uint token, bool masterLaunch) = abi.decode( params, (uint, address, uint, uint, bool) ); slave_buy(srcChainId, sender, target, native, token, masterLaunch, nonce); } else if (action == uint8(ActionType.sellPong)) { (uint nonce, address target, uint native, uint token) = abi.decode(params, (uint, address, uint, uint)); slave_sell(srcChainId, sender, target, native, token, nonce); } else if (action == uint8(ActionType.unStakePong)) { (uint nonce, address target, uint token) = abi.decode(params, (uint, address, uint)); slave_unstake(target, token, nonce); } else if (action == uint8(ActionType.crossPing)) { (uint nonce, uint64 chainid, address to, uint token) = abi.decode(params, (uint, uint64, address, uint)); slave_cross(srcChainId, sender, chainid, to, token, nonce); } else revert NotImplement(); } //----slave call function slave_buy( uint64, address, address target, uint native, uint token, bool masterLaunch, uint nonce ) internal virtual { require(!buyNoncePong[target][nonce], "nonce repetition"); if (!launched) { launched = masterLaunch; } buyNoncePong[target][nonce] = true; if (token > 0) _mint(target, token); if (native > 0) transferNative(target, native); } function slave_sell(uint64, address, address target, uint native, uint token, uint nonce) internal virtual { require(!sellNoncePong[target][nonce], "nonce repetition"); sellNoncePong[target][nonce] = true; if (!launched) { if (native < depositPing[target]) { depositPing[target] -= native; } else { depositPing[target] = 0; } } if (token > 0) _mint(target, token); if (native > 0) transferNative(target, native); } // ----Signature--- uint public cutShortTime = 600; //10 minute function setCutShortTime(uint time) public onlyOwner { cutShortTime = time; } bool public signSwitch = false; function setSignSwitch(bool pause_) public onlyOwner { signSwitch = pause_; } //----_buy uint public swapTime = 100; //60 minute function setSwapTime(uint time) public onlyOwner { swapTime = time; } function _buy(uint pongFee, address to, uint amountOutMinimum) internal virtual { uint nonce = buyNonce[_msgSender()] + 1; IChannelSlave _channel = IChannelSlave(_factory.getChannelAddress()); uint pingFee = _channel.buyPingEstimateGas(pongFee, symbol(), to, msg.value, amountOutMinimum, nonce); if (pongFee == 0) { pongFee = pingFee; } uint amountIn = msg.value - pingFee - pongFee; require(amountIn >= nativeMin, "the amount cannot be too small"); require(amountIn <= nativeMax, "the amount cannot be too large"); if (!launched) { depositPing[_msgSender()] += amountIn; require(depositPing[_msgSender()] <= depositTotal(_msgSender()), "pay too much"); } _channel.buyPing{value: msg.value}( pingFee, pongFee, _msgSender(), symbol(), to, amountIn, amountOutMinimum, nonce ); buyNonce[_msgSender()]++; } function _sell(uint pongFee, address from, address to, uint amountIn, uint amountOutMinimum) internal virtual { uint nonce = sellNonce[_msgSender()] + 1; require(amountIn > 0, "amount in err."); require(balanceOf(from) >= amountIn, "sell amount exceeds balance"); IChannelSlave _channel = IChannelSlave(_factory.getChannelAddress()); uint pingFee = _channel.sellPingEstimateGas(pongFee, symbol(), to, amountIn, amountOutMinimum, nonce); if (pongFee == 0) { pongFee = pingFee; } require(msg.value >= pingFee + pongFee, "bridge fee not enough"); require(amountIn >= tokenMin, "the amount cannot be too small"); _burn(from, amountIn); _channel.sellPing{value: msg.value}( pingFee, pongFee, _msgSender(), symbol(), to, amountIn, amountOutMinimum, nonce ); sellNonce[_msgSender()]++; } bool public swapPause = false; function setSwapPause(bool pause_) public onlyOwner { swapPause = pause_; } function swapExactETHForTokens( uint pongFee, address to, uint amountOutMinimum, bytes calldata signature ) external payable virtual { require(!swapPause, "swap pause"); if (signSwitch && !launched) { bytes32 hash = IChannelSlave(_factory.getChannelAddress()).getHash( "buy", symbol(), msg.value, _msgSender() ); require(SignatureChecker.isValidSignatureNow(signer, hash, signature), "verify error"); } _buy(pongFee, to, amountOutMinimum); } function swapExactTokensForETH( uint pongFee, uint amountIn, address to, uint amountOutMinimum ) external payable virtual { require(!swapPause, "swap pause"); _sell(pongFee, _msgSender(), to, amountIn, amountOutMinimum); } function slave_cross(uint64 srcChainId, address, uint64 dstChainId, address to, uint token, uint nonce) internal { require(!crossNoncePing[srcChainId][to][nonce], "nonce repetition"); crossNoncePing[srcChainId][to][nonce] = true; require(dstChainId == block.chainid, "chain id err"); if (token > 0) _mint(to, token); emit Crossed(srcChainId, to, to, token, nonce); } function crossToEstimateGas(uint64 dstChainId, address to, uint amount) public view virtual returns (uint pingFee) { uint nonce = crossNonce[dstChainId][to]; pingFee = IChannelSlave(_factory.getChannelAddress()).paramsEstimateGas( 0, _crossPingSignature(nonce + 1, dstChainId, to, amount) ); } function crossTo(uint64 dstChainId, address to, uint amount) external payable virtual { address owner = _msgSender(); require(balanceOf(owner) >= amount, "insufficient balance"); _burn(owner, amount); uint nonce = crossNonce[block.chainid][_msgSender()]; uint pingFee = crossToEstimateGas(dstChainId, to, amount); IChannelSlave(_factory.getChannelAddress()).paramsEmit2LaunchPad{value: msg.value}( pingFee, 0, _crossPingSignature(nonce + 1, dstChainId, to, amount), _msgSender() ); crossNonce[block.chainid][_msgSender()]++; } mapping(address => mapping(uint => bool)) public unStakeNoncePing; mapping(address => uint) public unStakeNonce; function _stakePingSignature(address target, uint token, uint duration) internal view returns (bytes memory) { return abi.encode(uint8(ActionType.stakePing), symbol(), 0, abi.encode(target, token, duration)); } function stakePingEstimateGas( address target, uint token, uint duration ) public view virtual returns (uint pingFee) { pingFee = IChannelSlave(_factory.getChannelAddress()).paramsEstimateGas( 0, _stakePingSignature(target, token, duration) ); } function stake(uint token, uint duration) external payable virtual { require(token > 0, "token in err."); address target = _msgSender(); require(balanceOf(target) >= token, "stake amount exceeds balance"); uint pingFee = stakePingEstimateGas(target, token, duration); require(msg.value >= pingFee, "bridge fee not enough"); bytes memory params = _stakePingSignature(target, token, duration); _burn(target, token); IChannelSlave(_factory.getChannelAddress()).paramsEmit2LaunchPad{value: msg.value}( pingFee, 0, params, _msgSender() ); } function slave_unstake(address target, uint token, uint nonce) internal { require(!unStakeNoncePing[target][nonce], "nonce repetition"); unStakeNoncePing[target][nonce] = true; if (token > 0) _mint(target, token); } function _unStakePingSignature( uint nonce, address target, uint pongFee, uint token ) internal view virtual returns (bytes memory) { return abi.encode(uint8(ActionType.unStakePing), symbol(), pongFee, abi.encode(nonce, target, token)); } function unStakePingEstimateGas( uint pongFee, address target, uint token ) public view virtual returns (uint pingFee) { uint nonce = unStakeNonce[_msgSender()]; pingFee = IChannelSlave(_factory.getChannelAddress()).paramsEstimateGas( pongFee, _unStakePingSignature(nonce + 1, target, pongFee, token) ); } function unStake(uint pongFee, uint token) external payable virtual { require(token > 0, "token in err."); address target = _msgSender(); uint pingFee = unStakePingEstimateGas(pongFee, target, token); require(msg.value >= pingFee + pongFee, "bridge fee not enough"); uint nonce = unStakeNonce[target]; bytes memory params = _unStakePingSignature(nonce + 1, target, pongFee, token); IChannelSlave(_factory.getChannelAddress()).paramsEmit2LaunchPad{value: msg.value}( pingFee, pongFee, params, _msgSender() ); unStakeNonce[target]++; } /** * @dev Fallback function to buy tokens with ETH. */ receive() external payable virtual { _buy(0, _msgSender(), 0); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } 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"); } } /** * @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) { 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 { 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 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 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Gnosis Safe. * * _Available since v4.1._ */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); return (error == ECDSA.RecoverError.NoError && recovered == signer) || isValidERC1271SignatureNow(signer, hash, signature); } /** * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated * against the signer smart contract using ERC1271. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidERC1271SignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length >= 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _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) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; enum ActionType { buyPing, buyPong, sellPing, sellPong, crossPing, stakePing, unStakePing, unStakePong }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IChannelSlaveBase} from "./IChannelSlaveBase.sol"; interface IChannelSlave is IChannelSlaveBase { function paramsEstimateGas(uint value, bytes memory params) external view returns (uint); function paramsEmit2LaunchPad(uint bridgeFee, uint value, bytes memory params, address sender) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IChannelSlaveBase { function getHash( string memory biz, string memory symbol, uint amount, address sender ) external pure returns (bytes32); function buyPingEstimateGas( uint pongFee, string memory _symbol, address target, uint amountIn, uint amountOutMinimum, uint nonce ) external view returns (uint pingFee); function buyPing( uint pingFee, uint pongFee, address sender, string memory _symbol, address target, uint amountInETH, uint amountOutMinimum, uint nonce ) external payable; function sellPingEstimateGas( uint pongFee, string memory _symbol, address target, uint amountIn, uint amountOutMinimum, uint nonce ) external view returns (uint pingFee); function sellPing( uint pingFee, uint pongFee, address sender, string memory _symbol, address target, uint amountIn, uint amountOutMinimum, uint nonce ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IProductBase} from "./IProductBase.sol"; interface IFactoryBase { function getChannelAddress() external view returns (address); function getProduct(string memory symbol_) external view returns (IProductBase); function getSymbol(address _addr) external view returns (string memory); function existProduct(address _addr) external view returns (bool); function getShortByLong(address longAddr) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IFactoryBase} from "./IFactoryBase.sol"; interface IFactorySlave is IFactoryBase {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IProductBase { function actionCall( bytes32 messageId, uint64 srcChainId, address sender, uint8 action, uint pongFee, bytes memory params ) external payable; function getFactoryAddress() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ActionType} from "../constants/ActionType.sol"; import {IFactoryBase} from "../interface/IFactoryBase.sol"; import {IProductBase} from "../interface/IProductBase.sol"; abstract contract LikwidProduct is IProductBase, ERC20, Ownable { error NotImplement(); using Strings for uint256; event MessageReceived(uint64 _srcChainId, address _srcAddress, uint value, bytes _payload, bytes32 messageId); event Crossed(uint64 _srcChainId, address _sender, address _to, uint _token, uint nonce); mapping(uint => mapping(address => mapping(uint => bool))) public crossNoncePing; mapping(uint => mapping(address => uint)) public crossNonce; bool public launched; address public feeAddress; uint public omniSupply; uint public launchFunds; uint public launchTime; uint public launchHardCap; address public creatorAddr; address public factoryAddress; function setFeeAddress(address addr) public virtual onlyOwner { feeAddress = addr; } function setCreatorAddr(address addr) public virtual onlyOwner { creatorAddr = addr; } function setLaunchHardCap(uint amount) public virtual onlyOwner { launchHardCap = amount; } function setLaunchTime(uint launchTime_) public virtual onlyOwner { launchTime = launchTime_; } uint public nativeMax = 5 ether; uint public nativeMin = 0.0001 ether; uint public tokenMin = 1 ether; uint public nativeTotal = 50 ether; function setNativeTotal(uint amount) public virtual onlyOwner { nativeTotal = amount; } function setNativeMax(uint amount) public virtual onlyOwner { nativeMax = amount; } function setNativeMin(uint amount) public virtual onlyOwner { nativeMin = amount; } function setTokenMin(uint amount) public virtual onlyOwner { tokenMin = amount; } function nowTime() public view returns (uint) { return block.timestamp; } function getFactoryAddress() public view returns (address) { return factoryAddress; } constructor( string memory _name, string memory _symbol, address _ownerAddr, address _factoryAddress, uint _omniSupply, uint _launchFunds, uint _launchTime, uint _launchHardCap, address _creatorAddr ) ERC20(_name, _symbol) { launched = false; feeAddress = _ownerAddr; omniSupply = _omniSupply; launchFunds = _launchFunds; launchTime = _launchTime; launchHardCap = _launchHardCap; creatorAddr = _creatorAddr; factoryAddress = _factoryAddress; require(launchFunds > 0, "launch funds err"); require(omniSupply > 0, "total supply init err"); } function transferNative(address to, uint amount) internal { (bool success, ) = to.call{value: amount}(""); require(success, string.concat("Product Transfer failed.", amount.toString())); } function action_func(bytes32, uint64, address, uint8, uint, bytes memory) internal virtual { revert NotImplement(); } function actionCall( bytes32 messageId, uint64 srcChainId, address sender, uint8 action, uint pongFee, bytes memory params ) external payable { require( _msgSender() == IFactoryBase(factoryAddress).getChannelAddress(), "LikwidProduct: caller must be channel" ); emit MessageReceived(srcChainId, sender, msg.value, params, messageId); action_func(messageId, srcChainId, sender, action, pongFee, params); } function _transfer(address from, address to, uint256 amount) internal virtual override { if (_msgSender() != address(this) && to == address(this)) { revert("Unsupported"); } else { super._transfer(from, to, amount); } } function _crossPingSignature( uint nonce, uint64 dstChainId, address target, uint token ) internal view virtual returns (bytes memory) { return abi.encode(uint8(ActionType.crossPing), symbol(), 0, abi.encode(nonce, dstChainId, target, token)); } }
{ "optimizer": { "enabled": true, "runs": 100 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
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":"_ownerAddr","type":"address"},{"internalType":"address","name":"_factoryAddress","type":"address"},{"internalType":"uint256","name":"_omniSupply","type":"uint256"},{"internalType":"uint256","name":"_launchFunds","type":"uint256"},{"internalType":"uint256","name":"_launchTime","type":"uint256"},{"internalType":"uint256","name":"_launchHardCap","type":"uint256"},{"internalType":"address","name":"_creatorAddr","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotImplement","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":"uint64","name":"_srcChainId","type":"uint64"},{"indexed":false,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_token","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"Crossed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"_srcChainId","type":"uint64"},{"indexed":false,"internalType":"address","name":"_srcAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"messageId","type":"bytes32"}],"name":"MessageReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"_factory","outputs":[{"internalType":"contract IFactorySlave","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageId","type":"bytes32"},{"internalType":"uint64","name":"srcChainId","type":"uint64"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint8","name":"action","type":"uint8"},{"internalType":"uint256","name":"pongFee","type":"uint256"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"actionCall","outputs":[],"stateMutability":"payable","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":"address","name":"","type":"address"}],"name":"buyNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"buyNoncePong","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creatorAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"crossNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"crossNoncePing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"dstChainId","type":"uint64"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"crossTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"dstChainId","type":"uint64"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"crossToEstimateGas","outputs":[{"internalType":"uint256","name":"pingFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cutShortTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositPing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"depositTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFactoryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"launchCreatorTime","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchHardCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launched","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nowTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"omniSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sellNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"sellNoncePong","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setCreatorAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"setCutShortTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_launchCreatorTime","type":"uint8"}],"name":"setLaunchCreatorTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setLaunchHardCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"launchTime_","type":"uint256"}],"name":"setLaunchTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_launched","type":"bool"}],"name":"setLaunched","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setNativeMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setNativeMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setNativeTotal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pause_","type":"bool"}],"name":"setSignSwitch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pause_","type":"bool"}],"name":"setSwapPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"setSwapTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setTokenMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signSwitch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"stakePingEstimateGas","outputs":[{"internalType":"uint256","name":"pingFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pongFee","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"swapExactETHForTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pongFee","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"swapPause","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pongFee","type":"uint256"},{"internalType":"uint256","name":"token","type":"uint256"}],"name":"unStake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"unStakeNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"unStakeNoncePing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pongFee","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"token","type":"uint256"}],"name":"unStakePingEstimateGas","outputs":[{"internalType":"uint256","name":"pingFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106103895760003560e01c80636b0d3a12116101d357806395d89b4111610103578063b3affc511161009b578063b3affc5114610b58578063c5cc6b6a14610b6e578063d2d01b2214610b8e578063d54a5c7a14610ba1578063dd62ed3e14610bc1578063e40afab214610be1578063f00e51f914610c0e578063f2fde38b14610c2e578063f765d1c614610c4e57600080fd5b806395d89b4114610a3a578063966dae0e14610a4f5780639a93883614610a6f5780639ff46e7414610a8f578063a1c8c1d314610aaf578063a457c2d714610ac2578063a9059cbb14610ae2578063a9c2e36c14610b02578063acbd65e614610b2057600080fd5b80637d189f17116101765780637d189f17146109405780637fb181c1146109565780637fb3961c1461096c5780638014f749146109825780638091f3bf146109a25780638705fcd4146109bc5780638708fbbc146109dc5780638da5cb5b146109fc578063944d928d14610a1a57600080fd5b80636b0d3a12146108515780636c19e7831461087157806370a0823114610891578063715018a6146108b1578063763b45ba146108c6578063790ca413146108dc5780637b0472f0146108f25780637be368691461090557600080fd5b806333195d51116102b95780634fa57941116102515780634fa579411461073057806351932c9a1461075d5780635252281a1461077d5780635c0f7dd1146107935780635c7e072b146107a95780635cb4a455146107bc5780635f04a791146107dc5780636723b9621461081757806369ac3a4f1461083157600080fd5b806333195d51146105ff578063335f1b371461061f578063372caeb81461063257806339509351146106455780633c58a1541461066557806341275358146106855780634431665e146106aa5780634856a0cf146106ca5780634e2525e61461070357600080fd5b806315c3fc211161032c57806315c3fc21146104c557806316552393146104e557806318160ddd1461051d5780631b095b331461053257806323508be714610552578063238ac9331461057e57806323b872dd1461059e57806324fbafb0146105be578063313ce567146105eb57600080fd5b806306fdde03146103a2578063095ea7b3146103cd5780630d7d9fe6146103fd5780630eefd8861461041d57806310be675f1461045e57806311232b8814610478578063116d464f1461049c57806314ed913c146104b257600080fd5b3661039d5761039b6000336000610c64565b005b600080fd5b3480156103ae57600080fd5b506103b7610f59565b6040516103c491906131cb565b60405180910390f35b3480156103d957600080fd5b506103ed6103e83660046131fa565b610feb565b60405190151581526020016103c4565b34801561040957600080fd5b5061039b610418366004613226565b611005565b34801561042957600080fd5b506103ed61043836600461323f565b600660209081526000938452604080852082529284528284209052825290205460ff1681565b34801561046a57600080fd5b50601d546103ed9060ff1681565b34801561048457600080fd5b5061048e60105481565b6040519081526020016103c4565b3480156104a857600080fd5b5061048e600a5481565b61039b6104c036600461328c565b611012565b3480156104d157600080fd5b5061039b6104e0366004613226565b6111bb565b3480156104f157600080fd5b50600d54610505906001600160a01b031681565b6040516001600160a01b0390911681526020016103c4565b34801561052957600080fd5b5060025461048e565b34801561053e57600080fd5b5061039b61054d3660046132ca565b6111c8565b34801561055e57600080fd5b5060165461056c9060ff1681565b60405160ff90911681526020016103c4565b34801561058a57600080fd5b50601454610505906001600160a01b031681565b3480156105aa57600080fd5b506103ed6105b93660046132e7565b6111e3565b3480156105ca57600080fd5b5061048e6105d9366004613307565b601a6020526000908152604090205481565b3480156105f757600080fd5b50601261056c565b34801561060b57600080fd5b5061039b61061a366004613226565b611207565b34801561062b57600080fd5b504261048e565b61039b610640366004613324565b611214565b34801561065157600080fd5b506103ed6106603660046131fa565b61139f565b34801561067157600080fd5b5061048e61068036600461323f565b6113c1565b34801561069157600080fd5b506008546105059061010090046001600160a01b031681565b3480156106b657600080fd5b5061039b6106c53660046132ca565b6114c9565b3480156106d657600080fd5b506103ed6106e53660046131fa565b60208080526000928352604080842090915290825290205460ff1681565b34801561070f57600080fd5b5061048e61071e366004613307565b60216020526000908152604090205481565b34801561073c57600080fd5b5061048e61074b366004613307565b60176020526000908152604090205481565b34801561076957600080fd5b5061039b610778366004613226565b6114e4565b34801561078957600080fd5b5061048e60125481565b34801561079f57600080fd5b5061048e60155481565b61039b6107b7366004613346565b6114f1565b3480156107c857600080fd5b5061039b6107d736600461339b565b611527565b3480156107e857600080fd5b506103ed6107f73660046131fa565b601960209081526000928352604080842090915290825290205460ff1681565b34801561082357600080fd5b50601f546103ed9060ff1681565b34801561083d57600080fd5b5061039b61084c3660046132ca565b611545565b34801561085d57600080fd5b5061048e61086c366004613307565b6115c0565b34801561087d57600080fd5b5061039b61088c366004613307565b611628565b34801561089d57600080fd5b5061048e6108ac366004613307565b611652565b3480156108bd57600080fd5b5061039b61166d565b3480156108d257600080fd5b5061048e60115481565b3480156108e857600080fd5b5061048e600b5481565b61039b610900366004613324565b611681565b34801561091157600080fd5b506103ed6109203660046131fa565b601b60209081526000928352604080842090915290825290205460ff1681565b34801561094c57600080fd5b5061048e600c5481565b34801561096257600080fd5b5061048e601e5481565b34801561097857600080fd5b5061048e60095481565b34801561098e57600080fd5b5061048e61099d36600461328c565b611825565b3480156109ae57600080fd5b506008546103ed9060ff1681565b3480156109c857600080fd5b5061039b6109d7366004613307565b6118db565b3480156109e857600080fd5b5061039b6109f7366004613226565b61190b565b348015610a0857600080fd5b506005546001600160a01b0316610505565b348015610a2657600080fd5b5061039b610a35366004613226565b611918565b348015610a4657600080fd5b506103b7611925565b348015610a5b57600080fd5b50600e54610505906001600160a01b031681565b348015610a7b57600080fd5b5061039b610a8a366004613226565b611934565b348015610a9b57600080fd5b5061039b610aaa366004613226565b611941565b61039b610abd3660046133cc565b61194e565b348015610ace57600080fd5b506103ed610add3660046131fa565b611a88565b348015610aee57600080fd5b506103ed610afd3660046131fa565b611b03565b348015610b0e57600080fd5b50600e546001600160a01b0316610505565b348015610b2c57600080fd5b5061048e610b3b3660046134c4565b600760209081526000928352604080842090915290825290205481565b348015610b6457600080fd5b5061048e600f5481565b348015610b7a57600080fd5b50601354610505906001600160a01b031681565b61039b610b9c3660046134f4565b611b11565b348015610bad57600080fd5b5061039b610bbc366004613307565b611cd3565b348015610bcd57600080fd5b5061048e610bdc366004613589565b611cfd565b348015610bed57600080fd5b5061048e610bfc366004613307565b60186020526000908152604090205481565b348015610c1a57600080fd5b5061048e610c293660046135b7565b611d28565b348015610c3a57600080fd5b5061039b610c49366004613307565b611e17565b348015610c5a57600080fd5b5061048e601c5481565b33600090815260186020526040812054610c7f906001613602565b90506000601360009054906101000a90046001600160a01b03166001600160a01b031663995cf0a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfa9190613615565b90506000816001600160a01b0316631cc1d0bc87610d16611925565b883489896040518763ffffffff1660e01b8152600401610d3b96959493929190613632565b602060405180830381865afa158015610d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7c9190613679565b905085600003610d8a578095505b600086610d978334613692565b610da19190613692565b9050601054811015610dce5760405162461bcd60e51b8152600401610dc5906136a5565b60405180910390fd5b600f54811115610e205760405162461bcd60e51b815260206004820152601e60248201527f74686520616d6f756e742063616e6e6f7420626520746f6f206c6172676500006044820152606401610dc5565b60085460ff16610ea5573360009081526017602052604081208054839290610e49908490613602565b90915550610e589050336115c0565b336000908152601760205260409020541115610ea55760405162461bcd60e51b815260206004820152600c60248201526b0e0c2f240e8dede40daeac6d60a31b6044820152606401610dc5565b6001600160a01b038316636de2a39f34848a33610ec0611925565b8c888d8d6040518a63ffffffff1660e01b8152600401610ee79897969594939291906136dc565b6000604051808303818588803b158015610f0057600080fd5b505af1158015610f14573d6000803e3d6000fd5b505050505060186000610f243390565b6001600160a01b0316815260208101919091526040016000908120805491610f4b83613736565b919050555050505050505050565b606060038054610f689061374f565b80601f0160208091040260200160405190810160405280929190818152602001828054610f949061374f565b8015610fe15780601f10610fb657610100808354040283529160200191610fe1565b820191906000526020600020905b815481529060010190602001808311610fc457829003601f168201915b5050505050905090565b600033610ff9818585611e90565b60019150505b92915050565b61100d611fb5565b600f55565b338161101d82611652565b10156110625760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b6044820152606401610dc5565b61106c818361200f565b46600090815260076020908152604080832033845290915281205490611093868686611825565b9050601360009054906101000a90046001600160a01b03166001600160a01b031663995cf0a46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190613615565b6001600160a01b031663549aa4a43483600061113461112c886001613602565b8c8c8c61212c565b336040518663ffffffff1660e01b81526004016111549493929190613789565b6000604051808303818588803b15801561116d57600080fd5b505af1158015611181573d6000803e3d6000fd5b5050466000908152600760209081526040808320338452909152812080549450925090506111ae83613736565b9190505550505050505050565b6111c3611fb5565b601c55565b6111d0611fb5565b601d805460ff1916911515919091179055565b6000336111f18582856121a3565b6111fc858585612217565b506001949350505050565b61120f611fb5565b601255565b600081116112345760405162461bcd60e51b8152600401610dc5906137c1565b3360006112428483856113c1565b905061124e8482613602565b34101561126d5760405162461bcd60e51b8152600401610dc5906137e8565b6001600160a01b0382166000908152602160205260408120549061129d611295836001613602565b858888612275565b9050601360009054906101000a90046001600160a01b03166001600160a01b031663995cf0a46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113169190613615565b6001600160a01b031663549aa4a434858985336040518663ffffffff1660e01b81526004016113489493929190613789565b6000604051808303818588803b15801561136157600080fd5b505af1158015611375573d6000803e3d6000fd5b5050506001600160a01b03861660009081526021602052604081208054935091506111ae83613736565b600033610ff98185856113b28383611cfd565b6113bc9190613602565b611e90565b3360009081526021602090815260408083205460135482516326573c2960e21b8152925191936001600160a01b039091169263995cf0a492600480830193928290030181865afa158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190613615565b6001600160a01b031663cb1b3dd18661146261145a856001613602565b888a89612275565b6040518363ffffffff1660e01b815260040161147f929190613817565b602060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c09190613679565b95945050505050565b6114d1611fb5565b601f805460ff1916911515919091179055565b6114ec611fb5565b601055565b601f5460ff16156115145760405162461bcd60e51b8152600401610dc590613830565b61152184338486856122c3565b50505050565b61152f611fb5565b6016805460ff191660ff92909216919091179055565b6014546001600160a01b031633148061156857506005546001600160a01b031633145b6115ad5760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481cda59db995c8bdbdddb995c8818d85b1b60521b6044820152606401610dc5565b6008805460ff1916911515919091179055565b600d5460009081906001600160a01b03908116908416036115f5576016546015546115ee9160ff1690613854565b90506115fa565b506015545b80600003611614576064600a54611611919061386b565b90505b600a54811115610fff5750600a5492915050565b611630611fb5565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526020819052604090205490565b611675611fb5565b61167f6000612581565b565b600082116116a15760405162461bcd60e51b8152600401610dc5906137c1565b33826116ac82611652565b10156116fa5760405162461bcd60e51b815260206004820152601c60248201527f7374616b6520616d6f756e7420657863656564732062616c616e6365000000006044820152606401610dc5565b6000611707828585611d28565b9050803410156117295760405162461bcd60e51b8152600401610dc5906137e8565b60006117368386866125d3565b9050611742838661200f565b601360009054906101000a90046001600160a01b03166001600160a01b031663995cf0a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b99190613615565b6001600160a01b031663549aa4a43484600085336040518663ffffffff1660e01b81526004016117ec9493929190613789565b6000604051808303818588803b15801561180557600080fd5b505af1158015611819573d6000803e3d6000fd5b50505050505050505050565b6001600160401b03831660009081526007602090815260408083206001600160a01b0380871685529083528184205460135483516326573c2960e21b81529351919492169263995cf0a49260048083019391928290030181865afa158015611891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b59190613615565b6001600160a01b031663cb1b3dd160006114626118d3856001613602565b89898961212c565b6118e3611fb5565b600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611913611fb5565b601e55565b611920611fb5565b601155565b606060048054610f689061374f565b61193c611fb5565b600c55565b611949611fb5565b600b55565b600e60009054906101000a90046001600160a01b03166001600160a01b031663995cf0a46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c59190613615565b6001600160a01b0316336001600160a01b031614611a335760405162461bcd60e51b815260206004820152602560248201527f4c696b77696450726f647563743a2063616c6c6572206d757374206265206368604482015264185b9b995b60da1b6064820152608401610dc5565b7fe4380fd4c095a9eb700fe8fb27c47c6d4a3a05ef8abe96b81b0f5867af7e74ec858534848a604051611a6a95949392919061388d565b60405180910390a1611a8086868686868661263d565b505050505050565b60003381611a968286611cfd565b905083811015611af65760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610dc5565b6111fc8286868403611e90565b600033610ff9818585612217565b601f5460ff1615611b345760405162461bcd60e51b8152600401610dc590613830565b601d5460ff168015611b49575060085460ff16155b15611cc157601354604080516326573c2960e21b815290516000926001600160a01b03169163995cf0a49160048083019260209291908290030181865afa158015611b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bbc9190613615565b6001600160a01b031663b8b971b8611bd2611925565b34336040518463ffffffff1660e01b8152600401611bf2939291906138d5565b602060405180830381865afa158015611c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c339190613679565b601454604080516020601f8701819004810282018101909252858152929350611c84926001600160a01b03909216918491879087908190840183828082843760009201919091525061276392505050565b611cbf5760405162461bcd60e51b815260206004820152600c60248201526b3b32b934b33c9032b93937b960a11b6044820152606401610dc5565b505b611ccc858585610c64565b5050505050565b611cdb611fb5565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b601354604080516326573c2960e21b815290516000926001600160a01b03169163995cf0a49160048083019260209291908290030181865afa158015611d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d969190613615565b6001600160a01b031663cb1b3dd16000611db18787876125d3565b6040518363ffffffff1660e01b8152600401611dce929190613817565b602060405180830381865afa158015611deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0f9190613679565b949350505050565b611e1f611fb5565b6001600160a01b038116611e845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dc5565b611e8d81612581565b50565b6001600160a01b038316611ef25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610dc5565b6001600160a01b038216611f535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610dc5565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6005546001600160a01b0316331461167f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dc5565b6001600160a01b03821661206f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610dc5565b6001600160a01b038216600090815260208190526040902054818110156120e35760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610dc5565b6001600160a01b038316600081815260208181526040808320868603905560028054879003905551858152919291600080516020613b4d8339815191529101611fa8565b505050565b60606004612138611925565b60408051602081018990526001600160401b038816818301526001600160a01b038716606082015260808082018790528251808303909101815260a0820190925261218a93929160009160c001613938565b6040516020818303038152906040529050949350505050565b60006121af8484611cfd565b90506000198114611521578181101561220a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610dc5565b6115218484848403611e90565b33301480159061222f57506001600160a01b03821630145b1561226a5760405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b6044820152606401610dc5565b6121278383836127c4565b60606006612281611925565b60408051602081018990526001600160a01b038816818301526060808201879052825180830390910181526080820190925261218a939291879160a00161397a565b336000908152601a60205260408120546122de906001613602565b9050600083116123215760405162461bcd60e51b815260206004820152600e60248201526d30b6b7bab73a1034b71032b9391760911b6044820152606401610dc5565b8261232b86611652565b10156123795760405162461bcd60e51b815260206004820152601b60248201527f73656c6c20616d6f756e7420657863656564732062616c616e636500000000006044820152606401610dc5565b601354604080516326573c2960e21b815290516000926001600160a01b03169163995cf0a49160048083019260209291908290030181865afa1580156123c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e79190613615565b90506000816001600160a01b031663463fe96889612403611925565b898989896040518763ffffffff1660e01b815260040161242896959493929190613632565b602060405180830381865afa158015612445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124699190613679565b905087600003612477578097505b6124818882613602565b3410156124a05760405162461bcd60e51b8152600401610dc5906137e8565b6011548510156124c25760405162461bcd60e51b8152600401610dc5906136a5565b6124cc878661200f565b6001600160a01b03821663b51c39d934838b336124e7611925565b8c8c8c8c6040518a63ffffffff1660e01b815260040161250e9897969594939291906136dc565b6000604051808303818588803b15801561252757600080fd5b505af115801561253b573d6000803e3d6000fd5b5050505050601a600061254b3390565b6001600160a01b031681526020810191909152604001600090812080549161257283613736565b91905055505050505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060056125df611925565b604080516001600160a01b03881660208201529081018690526060810185905260009060800160408051601f198184030181529082905261262594939291602001613938565b60405160208183030381529060405290509392505050565b60001960ff8416016126885760008060008060008580602001905181019061266591906139ae565b9450945094509450945061267e8a8a868686868b612956565b5050505050611a80565b60021960ff8416016126cd57600080600080848060200190518101906126ae9190613a06565b93509350935093506126c4898985858589612a0a565b50505050611a80565b60061960ff84160161270b576000806000838060200190518101906126f29190613a44565b925092509250612703828285612b13565b505050611a80565b60031960ff84160161274757600080600080848060200190518101906127319190613a7d565b93509350935093506126c4898985858589612b91565b60405160016235f76760e11b0319815260040160405180910390fd5b60008060006127728585612cdc565b9092509050600081600481111561278b5761278b613922565b1480156127a95750856001600160a01b0316826001600160a01b0316145b806127ba57506127ba868686612d21565b9695505050505050565b6001600160a01b0383166128285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610dc5565b6001600160a01b03821661288a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610dc5565b6001600160a01b038316600090815260208190526040902054818110156129025760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610dc5565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701905592518581529092600080516020613b4d833981519152910160405180910390a3611521565b6001600160a01b038516600090815260196020908152604080832084845290915290205460ff161561299a5760405162461bcd60e51b8152600401610dc590613ac6565b60085460ff166129b3576008805460ff19168315151790555b6001600160a01b03851660009081526019602090815260408083208484529091529020805460ff1916600117905582156129f1576129f18584612e0d565b8315612a0157612a018585612eba565b50505050505050565b6001600160a01b0384166000908152601b6020908152604080832084845290915290205460ff1615612a4e5760405162461bcd60e51b8152600401610dc590613ac6565b6001600160a01b0384166000908152601b602090815260408083208484529091529020805460ff1916600117905560085460ff16612af3576001600160a01b038416600090815260176020526040902054831015612ad9576001600160a01b03841660009081526017602052604081208054859290612ace908490613692565b90915550612af39050565b6001600160a01b0384166000908152601760205260408120555b8115612b0357612b038483612e0d565b8215611a8057611a808484612eba565b6001600160a01b03831660009081526020808052604080832084845290915290205460ff1615612b555760405162461bcd60e51b8152600401610dc590613ac6565b6001600160a01b0383166000908152602080805260408083208484529091529020805460ff191660011790558115612127576121278383612e0d565b6001600160401b03861660009081526006602090815260408083206001600160a01b0387168452825280832084845290915290205460ff1615612be65760405162461bcd60e51b8152600401610dc590613ac6565b6001600160401b0380871660009081526006602090815260408083206001600160a01b038816845282528083208584529091529020805460ff1916600117905584164614612c655760405162461bcd60e51b815260206004820152600c60248201526b31b430b4b71034b21032b93960a11b6044820152606401610dc5565b8115612c7557612c758383612e0d565b604080516001600160401b03881681526001600160a01b0385166020820181905281830152606081018490526080810183905290517f1c632a7a248c29ea7884a8324f916f13dbb7519f10f16833f711879a8aa670d29181900360a00190a1505050505050565b6000808251604103612d125760208301516040840151606085015160001a612d0687828585612f57565b94509450505050612d1a565b506000905060025b9250929050565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401612d4b929190613817565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612d899190613af0565b600060405180830381855afa9150503d8060008114612dc4576040519150601f19603f3d011682016040523d82523d6000602084013e612dc9565b606091505b5091509150818015612ddd57506020815110155b80156127ba57508051630b135d3f60e11b90612e029083016020908101908401613679565b149695505050505050565b6001600160a01b038216612e635760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610dc5565b8060026000828254612e759190613602565b90915550506001600160a01b03821660008181526020818152604080832080548601905551848152600080516020613b4d833981519152910160405180910390a35050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612f07576040519150601f19603f3d011682016040523d82523d6000602084013e612f0c565b606091505b5050905080612f1a83613011565b604051602001612f2a9190613b0c565b604051602081830303815290604052906115215760405162461bcd60e51b8152600401610dc591906131cb565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115612f845750600090506003613008565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612fd8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661300157600060019250925050613008565b9150600090505b94509492505050565b6060600061301e836130a3565b60010190506000816001600160401b0381111561303d5761303d6133b6565b6040519080825280601f01601f191660200182016040528015613067576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461307157509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106130e25772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061310e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061312c57662386f26fc10000830492506010015b6305f5e1008310613144576305f5e100830492506008015b612710831061315857612710830492506004015b6064831061316a576064830492506002015b600a8310610fff5760010192915050565b60005b8381101561319657818101518382015260200161317e565b50506000910152565b600081518084526131b781602086016020860161317b565b601f01601f19169290920160200192915050565b6020815260006131de602083018461319f565b9392505050565b6001600160a01b0381168114611e8d57600080fd5b6000806040838503121561320d57600080fd5b8235613218816131e5565b946020939093013593505050565b60006020828403121561323857600080fd5b5035919050565b60008060006060848603121561325457600080fd5b833592506020840135613266816131e5565b929592945050506040919091013590565b6001600160401b0381168114611e8d57600080fd5b6000806000606084860312156132a157600080fd5b83356132ac81613277565b92506020840135613266816131e5565b8015158114611e8d57600080fd5b6000602082840312156132dc57600080fd5b81356131de816132bc565b6000806000606084860312156132fc57600080fd5b83356132ac816131e5565b60006020828403121561331957600080fd5b81356131de816131e5565b6000806040838503121561333757600080fd5b50508035926020909101359150565b6000806000806080858703121561335c57600080fd5b84359350602085013592506040850135613375816131e5565b9396929550929360600135925050565b803560ff8116811461339657600080fd5b919050565b6000602082840312156133ad57600080fd5b6131de82613385565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060c087890312156133e557600080fd5b8635955060208701356133f781613277565b94506040870135613407816131e5565b935061341560608801613385565b92506080870135915060a08701356001600160401b038082111561343857600080fd5b818901915089601f83011261344c57600080fd5b81358181111561345e5761345e6133b6565b604051601f8201601f19908116603f01168101908382118183101715613486576134866133b6565b816040528281528c602084870101111561349f57600080fd5b8260208601602083013760006020848301015280955050505050509295509295509295565b600080604083850312156134d757600080fd5b8235915060208301356134e9816131e5565b809150509250929050565b60008060008060006080868803121561350c57600080fd5b85359450602086013561351e816131e5565b93506040860135925060608601356001600160401b038082111561354157600080fd5b818801915088601f83011261355557600080fd5b81358181111561356457600080fd5b89602082850101111561357657600080fd5b9699959850939650602001949392505050565b6000806040838503121561359c57600080fd5b82356135a7816131e5565b915060208301356134e9816131e5565b6000806000606084860312156135cc57600080fd5b83356135d7816131e5565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610fff57610fff6135ec565b60006020828403121561362757600080fd5b81516131de816131e5565b86815260c06020820152600061364b60c083018861319f565b6001600160a01b03969096166040830152506060810193909352608083019190915260a09091015292915050565b60006020828403121561368b57600080fd5b5051919050565b81810381811115610fff57610fff6135ec565b6020808252601e908201527f74686520616d6f756e742063616e6e6f7420626520746f6f20736d616c6c0000604082015260600190565b888152602081018890526001600160a01b0387811660408301526101006060830181905260009161370f8483018a61319f565b97166080840152505060a081019390935260c083019190915260e090910152949350505050565b600060018201613748576137486135ec565b5060010190565b600181811c9082168061376357607f821691505b60208210810361378357634e487b7160e01b600052602260045260246000fd5b50919050565b8481528360208201526080604082015260006137a8608083018561319f565b905060018060a01b038316606083015295945050505050565b6020808252600d908201526c3a37b5b2b71034b71032b9391760991b604082015260600190565b6020808252601590820152740c4e4d2c8ceca40cccaca40dcdee840cadcdeeaced605b1b604082015260600190565b828152604060208201526000611e0f604083018461319f565b6020808252600a90820152697377617020706175736560b01b604082015260600190565b8082028115828204841417610fff57610fff6135ec565b60008261388857634e487b7160e01b600052601260045260246000fd5b500490565b6001600160401b038616815260018060a01b038516602082015283604082015260a0606082015260006138c360a083018561319f565b90508260808301529695505050505050565b60808152600360808201526262757960e81b60a082015260c06020820152600061390260c083018661319f565b6040830194909452506001600160a01b0391909116606090910152919050565b634e487b7160e01b600052602160045260246000fd5b60ff85168152608060208201526000613954608083018661319f565b60ff85166040840152828103606084015261396f818561319f565b979650505050505050565b60ff85168152608060208201526000613996608083018661319f565b846040840152828103606084015261396f818561319f565b600080600080600060a086880312156139c657600080fd5b8551945060208601516139d8816131e5565b80945050604086015192506060860151915060808601516139f8816132bc565b809150509295509295909350565b60008060008060808587031215613a1c57600080fd5b845193506020850151613a2e816131e5565b6040860151606090960151949790965092505050565b600080600060608486031215613a5957600080fd5b835192506020840151613a6b816131e5565b80925050604084015190509250925092565b60008060008060808587031215613a9357600080fd5b845193506020850151613aa581613277565b6040860151909350613ab6816131e5565b6060959095015193969295505050565b60208082526010908201526f3737b731b2903932b832ba34ba34b7b760811b604082015260600190565b60008251613b0281846020870161317b565b9190910192915050565b77283937b23ab1ba102a3930b739b332b9103330b4b632b21760411b815260008251613b3f81601885016020870161317b565b919091016018019291505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c253c0b8bc6e3b4761197861a229c1756efd997155f6e7a30c285eccf2eb5f9e64736f6c63430008170033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.