Source Code
Latest 25 from a total of 957 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Redeem | 24683978 | 18 hrs ago | IN | 0 ETH | 0.00001218 | ||||
| Redeem | 24683744 | 19 hrs ago | IN | 0 ETH | 0.00000746 | ||||
| Lock | 24683726 | 19 hrs ago | IN | 0 ETH | 0.00000466 | ||||
| Redeem | 24673868 | 2 days ago | IN | 0 ETH | 0.00002351 | ||||
| Redeem | 24672815 | 2 days ago | IN | 0 ETH | 0.00003342 | ||||
| Lock | 24672778 | 2 days ago | IN | 0 ETH | 0.0000118 | ||||
| Redeem | 24671856 | 2 days ago | IN | 0 ETH | 0.00004321 | ||||
| Lock | 24671837 | 2 days ago | IN | 0 ETH | 0.00003018 | ||||
| Lock | 24671331 | 2 days ago | IN | 0 ETH | 0.00021835 | ||||
| Lock | 24664793 | 3 days ago | IN | 0 ETH | 0.00019409 | ||||
| Lock | 24648988 | 5 days ago | IN | 0 ETH | 0.00004193 | ||||
| Lock | 24641591 | 6 days ago | IN | 0 ETH | 0.00001058 | ||||
| Redeem | 24626867 | 8 days ago | IN | 0 ETH | 0.00000748 | ||||
| Lock | 24616320 | 10 days ago | IN | 0 ETH | 0.00000661 | ||||
| Redeem | 24616316 | 10 days ago | IN | 0 ETH | 0.00001165 | ||||
| Lock | 24616160 | 10 days ago | IN | 0 ETH | 0.00000309 | ||||
| Redeem | 24616131 | 10 days ago | IN | 0 ETH | 0.00000548 | ||||
| Lock | 24610779 | 11 days ago | IN | 0 ETH | 0.00000295 | ||||
| Redeem | 24610777 | 11 days ago | IN | 0 ETH | 0.00000426 | ||||
| Lock | 24608977 | 11 days ago | IN | 0 ETH | 0.00000253 | ||||
| Redeem | 24608975 | 11 days ago | IN | 0 ETH | 0.00000408 | ||||
| Lock | 24608546 | 11 days ago | IN | 0 ETH | 0.00000316 | ||||
| Redeem | 24608543 | 11 days ago | IN | 0 ETH | 0.0000046 | ||||
| Lock | 24608523 | 11 days ago | IN | 0 ETH | 0.00000372 | ||||
| Redeem | 24608521 | 11 days ago | IN | 0 ETH | 0.00000636 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BridgeVault
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import './lib/massaUtils.sol';
contract BridgeVault is Ownable, Pausable {
using SafeERC20 for IERC20;
event Locked(address indexed sender, address indexed token, string massaAddress, uint amount, uint lockedAmount);
event Redeemed(address indexed recipient, address indexed token, string burnOpId, uint amount);
event TokenAdded(address indexed token);
event TokenRemoved(address indexed token);
event SignerAdded(address indexed signer);
event SignerRemoved(address indexed signer);
event FeeSet(uint _fee, string _type);
event FeeWithdraw(uint _amount, address indexed token);
event ThresholdChanged(uint _k);
mapping(address => bool) public supportedTokens;
address[] private tokens;
mapping(bytes32 => bool) public executedOpIds;
address[] public signers;
uint public lockFee;
uint public redeemFee;
address public multisigAdmin;
uint public k;
uint8 private constant version = 0;
mapping(address => uint) public fees;
constructor(address[] memory initialSigners, address _multisigAdmin, uint _k) {
require(_multisigAdmin != address(0), 'Multisig admin cannot be the zero address');
uint nbSigners = initialSigners.length;
require(nbSigners > 0, 'At least one signer is required');
require(_k > 0 && _k <= nbSigners, 'Invalid k value');
k = _k;
for (uint i = 0; i < nbSigners; ) {
for (uint j = 0; j < nbSigners; ) {
if (i != j) {
require(initialSigners[i] != initialSigners[j], 'Signers must be unique');
}
unchecked {
++j;
}
}
require(initialSigners[i] != address(0), 'Signer cannot be the zero address');
signers.push(initialSigners[i]);
unchecked {
++i;
}
}
lockFee = 0;
redeemFee = 10;
multisigAdmin = _multisigAdmin;
}
function lock(uint amount, string calldata massaAddress, address tokenContract) public whenNotPaused {
require(amount > 0, 'Amount must be greater than 0');
require(supportedTokens[tokenContract], 'Token not supported');
require(MassaUtils.validateMassaAddress(massaAddress), 'Invalid Massa address');
uint feeAmount = (amount * lockFee) / 10000;
fees[tokenContract] += feeAmount;
IERC20(tokenContract).safeTransferFrom(msg.sender, address(this), amount);
emit Locked(msg.sender, tokenContract, massaAddress, amount, amount - feeAmount);
}
function redeem(
uint amount,
address recipient,
string calldata burnOpId,
address tokenContract,
bytes[] calldata signatures
) external whenNotPaused {
uint nbSigners = signers.length;
require(supportedTokens[tokenContract], 'Token not supported');
require(signatures.length >= k, 'Amount of signatures is not sufficient');
require(!executedOpIds[keccak256(abi.encodePacked(burnOpId))], 'Operation already executed');
bytes32 message = ECDSA.toEthSignedMessageHash(
keccak256(abi.encodePacked(version, amount, recipient, burnOpId, tokenContract, block.chainid))
);
uint validSignatures = 0;
bool[] memory usedSignatures = new bool[](nbSigners);
for (uint i = 0; i < signatures.length; ) {
address recovered = ECDSA.recover(message, signatures[i]);
for (uint j = 0; j < nbSigners; ) {
if (recovered == signers[j] && !usedSignatures[j]) {
usedSignatures[j] = true;
unchecked {
++validSignatures;
}
break;
}
unchecked {
++j;
}
}
if (validSignatures == k) {
break;
}
unchecked {
++i;
}
}
require(validSignatures >= k, 'Invalid or insufficient valid signatures');
executedOpIds[keccak256(abi.encodePacked(burnOpId))] = true;
uint feeAmount = (amount * redeemFee) / 10000;
fees[tokenContract] += feeAmount;
uint redeemableAmount = amount - feeAmount;
IERC20(tokenContract).safeTransfer(recipient, redeemableAmount);
emit Redeemed(recipient, tokenContract, burnOpId, redeemableAmount);
}
function addToken(address token) external onlyOwner {
require(!supportedTokens[token], 'Token is already supported');
supportedTokens[token] = true;
tokens.push(token);
emit TokenAdded(token);
}
function removeToken(address token) external onlyOwner {
require(supportedTokens[token], 'Token is not supported');
supportedTokens[token] = false;
uint nbTokens = tokens.length;
for (uint i = 0; i < nbTokens; ) {
if (tokens[i] == token) {
tokens[i] = tokens[nbTokens - 1];
tokens.pop();
break;
}
unchecked {
++i;
}
}
emit TokenRemoved(token);
}
function supportedTokensList() public view returns (address[] memory) {
return tokens;
}
function getSigners() public view returns (address[] memory) {
return signers;
}
function pause() external {
require(msg.sender == multisigAdmin || msg.sender == owner(), 'Only multisigAdmin or owner can pause');
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function setLockFee(uint _fee) external onlyOwner {
require(_fee <= 10000, 'Fee cannot be greater than 100%');
lockFee = _fee;
emit FeeSet(_fee, 'lock');
}
function setRedeemFee(uint _fee) external onlyOwner {
require(_fee <= 10000, 'Fee cannot be greater than 100%');
redeemFee = _fee;
emit FeeSet(_fee, 'redeem');
}
function withdrawFees(address recipient) external {
require(msg.sender == multisigAdmin || msg.sender == owner(), 'Only multisigAdmin or owner can withdraw fees');
for (uint i = 0; i < tokens.length; ) {
address token = tokens[i];
uint amount = fees[token];
fees[token] = 0;
IERC20(token).safeTransfer(recipient, amount);
emit FeeWithdraw(amount, token);
unchecked {
++i;
}
}
}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
super.transferOwnership(newOwner);
}
function addSigner(address newSigner) external onlyOwner {
require(newSigner != address(0), 'Signer cannot be the zero address');
require(!isSigner(newSigner), 'Signer is already added');
signers.push(newSigner);
emit SignerAdded(newSigner);
}
function isSigner(address signer) public view returns (bool) {
uint nbSigners = signers.length;
for (uint i = 0; i < nbSigners; ) {
if (signers[i] == signer) {
return true;
}
unchecked {
++i;
}
}
return false;
}
function removeSigner(address signer) external onlyOwner {
uint nbSigners = signers.length;
require(nbSigners > k, 'Number of signers must be greater than threshold');
for (uint i = 0; i < nbSigners; ) {
if (signers[i] == signer) {
signers[i] = signers[nbSigners - 1];
signers.pop();
emit SignerRemoved(signer);
break;
}
unchecked {
++i;
}
}
}
function setMultisigAdmin(address _multisigAdmin) external onlyOwner {
require(_multisigAdmin != address(0), 'Multisig admin cannot be the zero address');
multisigAdmin = _multisigAdmin;
}
function setThreshold(uint _k) external onlyOwner {
require(_k > 0 && _k <= signers.length, 'Invalid k value');
k = _k;
emit ThresholdChanged(k);
}
}// 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/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// 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.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
}// 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/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.9;
library MassaUtils {
function validateMassaAddress(string calldata massaAddress) internal pure returns (bool) {
bytes memory massaAddressBytes = bytes(massaAddress);
uint addrLength = massaAddressBytes.length;
if (addrLength < 39 || addrLength > 64) {
return false;
}
if (massaAddressBytes[0] != 'A' || (massaAddressBytes[1] != 'U' && massaAddressBytes[1] != 'S')) {
return false;
}
for (uint i = 2; i < addrLength; ) {
bytes1 char = massaAddressBytes[i];
// Check if the character is within the allowed alphabet
bool isValidCharacter = ((char >= 0x31 && char <= 0x39) || // 1-9
(char >= 0x41 && char <= 0x48) || // A-H
(char >= 0x4A && char <= 0x4E) || // J-N
(char >= 0x50 && char <= 0x5A) || // P-Z
(char >= 0x61 && char <= 0x6B) || // a-k
(char >= 0x6D && char <= 0x7A)); // m-z
if (!isValidCharacter) {
return false;
}
unchecked {
++i;
}
}
return true;
}
}{
"optimizer": {
"enabled": true,
"runs": 100
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address[]","name":"initialSigners","type":"address[]"},{"internalType":"address","name":"_multisigAdmin","type":"address"},{"internalType":"uint256","name":"_k","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"},{"indexed":false,"internalType":"string","name":"_type","type":"string"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"FeeWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"string","name":"massaAddress","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockedAmount","type":"uint256"}],"name":"Locked","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"string","name":"burnOpId","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"}],"name":"SignerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"}],"name":"SignerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_k","type":"uint256"}],"name":"ThresholdChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"TokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"addSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"executedOpIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"fees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"k","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"massaAddress","type":"string"},{"internalType":"address","name":"tokenContract","type":"address"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multisigAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"burnOpId","type":"string"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"removeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setLockFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_multisigAdmin","type":"address"}],"name":"setMultisigAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setRedeemFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_k","type":"uint256"}],"name":"setThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"signers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supportedTokensList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60406080815234620003ad576200236b803803806200001e81620003c8565b928339810190606081830312620003ad5780516001600160401b039290838111620003ad5782019080601f83011215620003ad578151938411620003b2578360051b602092838062000072818501620003c8565b809881520192820101928311620003ad5783809101915b838310620003925750869250620000a391508401620003ee565b9201516000805486519591946001600160a01b039291839190338382167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08a80a36001600160a81b0319163360ff60a01b1916178755169586156200033e57508051928315620002fa5780151580620002ef575b15620002b957600855845b83811062000155576005869055600a600655600780546001600160a01b031916881790558751611f3c90816200042f8239f35b855b8481106200023f5750826200016d828462000403565b511615620001f1578262000182828462000403565b511690600491825468010000000000000000811015620001de57600193848201808255821015620001cb5789528789200180546001600160a01b03191690911790550162000122565b634e487b7160e01b8a5260329052602489fd5b634e487b7160e01b895260418452602489fd5b875162461bcd60e51b815260048101869052602160248201527f5369676e65722063616e6e6f7420626520746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b80820362000251575b60010162000157565b836200025e838562000403565b5116846200026d838662000403565b5116036200024857885162461bcd60e51b815260048101879052601660248201527f5369676e657273206d75737420626520756e69717565000000000000000000006044820152606490fd5b875162461bcd60e51b815260048101869052600f60248201526e496e76616c6964206b2076616c756560881b6044820152606490fd5b508381111562000117565b875162461bcd60e51b815260048101869052601f60248201527f4174206c65617374206f6e65207369676e6572206973207265717569726564006044820152606490fd5b62461bcd60e51b815260048101859052602960248201527f4d756c74697369672061646d696e2063616e6e6f7420626520746865207a65726044820152686f206164647265737360b81b6064820152608490fd5b81906200039f84620003ee565b815201910190839062000089565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b03811183821017620003b257604052565b51906001600160a01b0382168203620003ad57565b8051821015620004185760209160051b010190565b634e487b7160e01b600052603260045260246000fdfe6080604052600436101561001257600080fd5b60003560e01c80630e316ab714611429578063164e68de146113195780631ebac5c6146111525780632079fb9a146111105780633f4ba83a1461107457806356a06235146110565780635c975abb146110305780635d841af514610fb95780635fa7b58414610e3657806368c4ac2614610df75780636e8bf0e114610d5a578063715018a614610d015780637df73e2714610cd45780637e40525a14610ca35780638121ff9014610c215780638456cb5914610b485780638da5cb5b14610b1f57806394cf795e14610a8d578063960bfe04146109ef578063965fa21e146109d15780639f7260bd1461095c578063b4f40c611461093e578063baab6e9a14610915578063d48bfca714610829578063e3edb8901461035e578063eb12d61e14610212578063f2fde38b1461018f5763faaebd211461015057600080fd5b3461018a57602036600319011261018a576001600160a01b0361017161155e565b1660005260096020526020604060002054604051908152f35b600080fd5b3461018a57602036600319011261018a576101a861155e565b6101b0611631565b6001600160a01b03908116906101d88215156101cb81611c71565b6101d3611631565b611c71565b6000548260018060a01b0319821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b3461018a57602036600319011261018a5761022b61155e565b610233611631565b6001600160a01b03811690811561030f5761024d81611ccc565b6102d05760045490600160401b8210156102ba5761027482600161029394016004556115a1565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24600080a2005b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601760248201527614da59db995c881a5cc8185b1c9958591e481859191959604a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152602160248201527f5369676e65722063616e6e6f7420626520746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b3461018a5760a036600319011261018a576024356001600160a01b038116900361018a576044356001600160401b03811161018a576103a1903690600401611574565b906064356001600160a01b038116900361018a576001600160401b036084351161018a5736602360843501121561018a576001600160401b03608435600401351161018a573660246084356004013560051b60843501011161018a57610405611719565b6004546064356001600160a01b031660009081526001602052604090205461042f9060ff16611689565b600854908160843560040135106107d557604051602081019085858337610466602082888101600083820152038084520182611760565b519020600052600360205260ff60406000205416610790576040516000602082015260043560218201526104dc6089826bffffffffffffffffffffffff198060243560601b166041830152888860558401378882019060643560601b166055820152466069820152036069810184520182611760565b602081519101207f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c6000209060009161051c826119a0565b6105296040519182611760565b828152601f19610538846119a0565b0136602083013760005b6084356004013581106106a5575b505050501061064f5760405160208101908383833761057f602082868101600083820152038084520182611760565b51902060005260036020526040600020600160ff1982541617905561060a6105df6127106105b16006546004356116cb565b0460018060a01b0360643516600052600960205260406000206105d58282546116de565b90556004356116eb565b916105f8836024356064356001600160a01b0316611a02565b604051936040855260408501916116f8565b9060208301527fe442438f977cf13ed122d2e3462b1afe5a74fc3ad80af33b4962d673a5bbd37160018060a01b0360643516928060018060a01b0360243516930390a3005b60405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206f7220696e73756666696369656e742076616c6964207369604482015267676e61747572657360c01b6064820152608490fd5b60248160051b60843501013560421960843536030181121561018a57608435016001600160401b0360248201351161018a5760248101353603604482011361018a5761070761070161070f9236906044602482013591016119b7565b85611b68565b919091611a53565b60005b858110610730575b505085851461072b57600101610542565b610550565b610739816115a1565b905460039190911b1c6001600160a01b03908116908316148061077e575b61076357600101610712565b6001929691506107748391856119ee565b520193888061071a565b5061078981856119ee565b5115610757565b60405162461bcd60e51b815260206004820152601a60248201527f4f7065726174696f6e20616c72656164792065786563757465640000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602660248201527f416d6f756e74206f66207369676e617475726573206973206e6f7420737566666044820152651a58da595b9d60d21b6064820152608490fd5b3461018a57602036600319011261018a5761084261155e565b61084a611631565b6001600160a01b03811660008181526001602052604090205490919060ff166108d0578160005260016020526040600020600160ff1982541617905560025490600160401b8210156102ba576102748260016108a994016002556115d2565b7f784c8f4dbf0ffedd6e72c76501c545a70f8b203b30a26ce542bf92ba87c248a4600080a2005b60405162461bcd60e51b815260206004820152601a60248201527f546f6b656e20697320616c726561647920737570706f727465640000000000006044820152606490fd5b3461018a57600036600319011261018a576007546040516001600160a01b039091168152602090f35b3461018a57600036600319011261018a576020600854604051908152f35b3461018a57602036600319011261018a577ff1c9188ac961e8bd19c50ac88f72f585b190a9af6d3796d2c5cfba24e9ec7a42608060043561099b611631565b6109a9612710821115611c25565b806005556040519081526040602082015260046040820152636c6f636b60e01b6060820152a1005b3461018a57600036600319011261018a576020600654604051908152f35b3461018a57602036600319011261018a57600435610a0b611631565b80151580610a81575b15610a4a576020817f6c4ce60fd690e1216286a10b875c5662555f10774484e58142cedd7a90781baa92600855604051908152a1005b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206b2076616c756560881b6044820152606490fd5b50600454811115610a14565b3461018a57600036600319011261018a57604051600480548083526000918252602080840193927f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b92915b828210610aff57610afb85610aef81890382611760565b604051918291826115ed565b0390f35b83546001600160a01b031686529485019460019384019390910190610ad8565b3461018a57600036600319011261018a576000546040516001600160a01b039091168152602090f35b3461018a57600036600319011261018a57600754336001600160a01b0391821614908115610c13575b5015610bc057610b7f611719565b6000805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b60405162461bcd60e51b815260206004820152602560248201527f4f6e6c79206d756c746973696741646d696e206f72206f776e65722063616e20604482015264706175736560d81b6064820152608490fd5b905060005416331481610b71565b3461018a57600036600319011261018a57604051600280548083526000918252602080840193927f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace92915b828210610c8357610afb85610aef81890382611760565b83546001600160a01b031686529485019460019384019390910190610c6c565b3461018a57602036600319011261018a576004356000526003602052602060ff604060002054166040519015158152f35b3461018a57602036600319011261018a576020610cf7610cf261155e565b611ccc565b6040519015158152f35b3461018a57600036600319011261018a57610d1a611631565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461018a57602036600319011261018a57610d7361155e565b610d7b611631565b6001600160a01b03168015610da057600780546001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152602960248201527f4d756c74697369672061646d696e2063616e6e6f7420626520746865207a65726044820152686f206164647265737360b81b6064820152608490fd5b3461018a57602036600319011261018a576001600160a01b03610e1861155e565b166000526001602052602060ff604060002054166040519015158152f35b3461018a57602036600319011261018a57610e4f61155e565b610e57611631565b60018060a01b0380911690816000526001908160205260ff6040600020541615610f7b578260005281602052604060002060ff198154169055600280549160005b838110610ec8575b857f4c910b69fe65a61f7531b9c5042b2329ca7179c77290aa7e2eb3afa3c8511fd3600080a2005b8186610ed3836115d2565b929054600393841b1c1614610eea57508401610e98565b929450600019939091848201918211610f6557610f1993610f0d610274936115d2565b9054911b1c16916115d2565b81548015610f4f570190610f44610f2f836115d2565b81549060018060a01b039060031b1b19169055565b558180808080610ea0565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b8152602060048201526016602482015275151bdad95b881a5cc81b9bdd081cdd5c1c1bdc9d195960521b6044820152606490fd5b3461018a57602036600319011261018a577ff1c9188ac961e8bd19c50ac88f72f585b190a9af6d3796d2c5cfba24e9ec7a426080600435610ff8611631565b611006612710821115611c25565b8060065560405190815260406020820152600660408201526572656465656d60d01b6060820152a1005b3461018a57600036600319011261018a57602060ff60005460a01c166040519015158152f35b3461018a57600036600319011261018a576020600554604051908152f35b3461018a57600036600319011261018a5761108d611631565b60005460ff8160a01c16156110d45760ff60a01b19166000556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b3461018a57602036600319011261018a5760043560045481101561018a576111396020916115a1565b905460405160039290921b1c6001600160a01b03168152f35b3461018a57606036600319011261018a576001600160401b0360043560243582811161018a57611186903690600401611574565b6044356001600160a01b03811694929085900361018a576111a5611719565b83156112d4578460005260016020526111c560ff60406000205416611689565b6111cf8282611d17565b15611297576127106111e3600554866116cb565b049285600052600960205260406000206111fe8582546116de565b90556040516323b872dd60e01b60208201523360248201523060448201526064808201879052815260a08101918211818310176102ba577f78a4518c05c7ababe3937649e215d6c585b14a47a7936d03ebf0ec95544d51679461126b61127192611284946040528961179c565b866116eb565b91604051936060855260608501916116f8565b93602083015260408201528033930390a3005b60405162461bcd60e51b8152602060048201526015602482015274496e76616c6964204d61737361206164647265737360581b6044820152606490fd5b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b3461018a5760208060031936011261018a5761133361155e565b6007546001600160a01b03919082163314801561141c575b156113c15760005b6002548110156113bf57808361136a6001936115d2565b90549060031b1c1680600052600986527f9826687c41651ba69cea32ce3452ab6943e1e3df42b47269d3a4b7bb5ddf88078660406000206000815491556113b2818886611a02565b604051908152a201611353565b005b60405162461bcd60e51b815260048101849052602d60248201527f4f6e6c79206d756c746973696741646d696e206f72206f776e65722063616e2060448201526c7769746864726177206665657360981b6064820152608490fd5b508160005416331461134b565b3461018a57602036600319011261018a5761144261155e565b61144a611631565b60045490600854821115611500576001600160a01b03908116919060005b82811061147157005b818461147c836115a1565b929054600393841b1c16146114945750600101611468565b600019939092848201918211610f65576114c0936114b4610274936115a1565b9054911b1c16916115a1565b6004548015610f4f57016114d6610f2f826115a1565b6004557f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b600080a2005b60405162461bcd60e51b815260206004820152603060248201527f4e756d626572206f66207369676e657273206d7573742062652067726561746560448201526f1c881d1a185b881d1a1c995cda1bdb1960821b6064820152608490fd5b600435906001600160a01b038216820361018a57565b9181601f8401121561018a578235916001600160401b03831161018a576020838186019501011161018a57565b6004548110156115bc57600460005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6002548110156115bc57600260005260206000200190600090565b6020908160408183019282815285518094520193019160005b828110611614575050505090565b83516001600160a01b031685529381019392810192600101611606565b6000546001600160a01b0316330361164557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561169057565b60405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd081cdd5c1c1bdc9d1959606a1b6044820152606490fd5b81810292918115918404141715610f6557565b91908201809211610f6557565b91908203918211610f6557565b908060209392818452848401376000828201840152601f01601f1916010190565b60ff60005460a01c1661172857565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b90601f801991011681019081106001600160401b038211176102ba57604052565b6001600160401b0381116102ba57601f01601f191660200190565b60018060a01b03169060405160408101908082106001600160401b038311176102ba5761182b916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af13d156118c8573d9161181083611781565b9261181e6040519485611760565b83523d868885013e6118cc565b80519182159184831561189d575b5050509050156118465750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126118c4578201519081151582036118c1575080388084611839565b80fd5b5080fd5b6060915b9192901561192e57508151156118e0575090565b3b156118e95790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156119415750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611987575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611964565b6001600160401b0381116102ba5760051b60200190565b9291926119c382611781565b916119d16040519384611760565b82948184528183011161018a578281602093846000960137010152565b80518210156115bc5760209160051b010190565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b038311828410176102ba57611a519260405261179c565b565b6005811015611b525780611a645750565b60018103611aac5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b60028103611af95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611b0257565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b906041815114600014611b9657611b92916020820151906060604084015193015160001a90611ba0565b9091565b5050600090600290565b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311611c195791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611c0c5781516001600160a01b03811615611c06579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b15611c2c57565b60405162461bcd60e51b815260206004820152601f60248201527f4665652063616e6e6f742062652067726561746572207468616e2031303025006044820152606490fd5b15611c7857565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b6004549060005b828110611ce257505050600090565b611ceb816115a1565b905460039190911b1c6001600160a01b0390811690831614611d0f57600101611cd3565b505050600190565b611d229136916119b7565b805190602782108015611efc575b611ef55781156115bc57602080820151604160f81b926001600160f81b0319929183168414801590611eb2575b611ea85760025b858110611d7657505050505050600190565b8151811015611e93578383828401015116603160f81b8110159081611e84575b8115611e64575b8115611e40575b8115611e1c575b8115611df8575b8115611dd2575b5015611dc757600101611d64565b505050505050600090565b606d60f81b811015915081611de9575b5038611db9565b603d60f91b1015905038611de2565b9050606160f81b81101580611e0e575b90611db2565b50606b60f81b811115611e08565b9050600560fc1b81101580611e32575b90611dab565b50602d60f91b811115611e2c565b9050602560f91b81101580611e56575b90611da4565b50602760f91b811115611e50565b90508581101580611e76575b90611d9d565b50600960fb1b811115611e70565b603960f81b8111159150611d96565b60246000634e487b7160e01b81526032600452fd5b5050505050600090565b508051600110156115bc576021810180518416605560f81b14159081611ed9575b50611d5d565b90508151600110156115bc57518316605360f81b141538611ed3565b5050600090565b5060408211611d3056fea26469706673582212208c0d3f976fd0f653299bff4ba4e930bec1a6abcfd85f60023b09ab58343359ea64736f6c634300081200330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000db1a35b0c8bb727a8ce5314b4fcca874614138bb000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000004eb0ac1de4ccc47f8fa5312a8face1f0b4154e7b000000000000000000000000239cb55cabb87336c6f8e5277a1fa2cb85fc08060000000000000000000000000e7e92e2ae0e28f04b1288c2b70a52262e9b9eaf000000000000000000000000c70f85ad44c092a8e300a9e4ae34628e96d5149a
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c80630e316ab714611429578063164e68de146113195780631ebac5c6146111525780632079fb9a146111105780633f4ba83a1461107457806356a06235146110565780635c975abb146110305780635d841af514610fb95780635fa7b58414610e3657806368c4ac2614610df75780636e8bf0e114610d5a578063715018a614610d015780637df73e2714610cd45780637e40525a14610ca35780638121ff9014610c215780638456cb5914610b485780638da5cb5b14610b1f57806394cf795e14610a8d578063960bfe04146109ef578063965fa21e146109d15780639f7260bd1461095c578063b4f40c611461093e578063baab6e9a14610915578063d48bfca714610829578063e3edb8901461035e578063eb12d61e14610212578063f2fde38b1461018f5763faaebd211461015057600080fd5b3461018a57602036600319011261018a576001600160a01b0361017161155e565b1660005260096020526020604060002054604051908152f35b600080fd5b3461018a57602036600319011261018a576101a861155e565b6101b0611631565b6001600160a01b03908116906101d88215156101cb81611c71565b6101d3611631565b611c71565b6000548260018060a01b0319821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b3461018a57602036600319011261018a5761022b61155e565b610233611631565b6001600160a01b03811690811561030f5761024d81611ccc565b6102d05760045490600160401b8210156102ba5761027482600161029394016004556115a1565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24600080a2005b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601760248201527614da59db995c881a5cc8185b1c9958591e481859191959604a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152602160248201527f5369676e65722063616e6e6f7420626520746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b3461018a5760a036600319011261018a576024356001600160a01b038116900361018a576044356001600160401b03811161018a576103a1903690600401611574565b906064356001600160a01b038116900361018a576001600160401b036084351161018a5736602360843501121561018a576001600160401b03608435600401351161018a573660246084356004013560051b60843501011161018a57610405611719565b6004546064356001600160a01b031660009081526001602052604090205461042f9060ff16611689565b600854908160843560040135106107d557604051602081019085858337610466602082888101600083820152038084520182611760565b519020600052600360205260ff60406000205416610790576040516000602082015260043560218201526104dc6089826bffffffffffffffffffffffff198060243560601b166041830152888860558401378882019060643560601b166055820152466069820152036069810184520182611760565b602081519101207f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c6000209060009161051c826119a0565b6105296040519182611760565b828152601f19610538846119a0565b0136602083013760005b6084356004013581106106a5575b505050501061064f5760405160208101908383833761057f602082868101600083820152038084520182611760565b51902060005260036020526040600020600160ff1982541617905561060a6105df6127106105b16006546004356116cb565b0460018060a01b0360643516600052600960205260406000206105d58282546116de565b90556004356116eb565b916105f8836024356064356001600160a01b0316611a02565b604051936040855260408501916116f8565b9060208301527fe442438f977cf13ed122d2e3462b1afe5a74fc3ad80af33b4962d673a5bbd37160018060a01b0360643516928060018060a01b0360243516930390a3005b60405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206f7220696e73756666696369656e742076616c6964207369604482015267676e61747572657360c01b6064820152608490fd5b60248160051b60843501013560421960843536030181121561018a57608435016001600160401b0360248201351161018a5760248101353603604482011361018a5761070761070161070f9236906044602482013591016119b7565b85611b68565b919091611a53565b60005b858110610730575b505085851461072b57600101610542565b610550565b610739816115a1565b905460039190911b1c6001600160a01b03908116908316148061077e575b61076357600101610712565b6001929691506107748391856119ee565b520193888061071a565b5061078981856119ee565b5115610757565b60405162461bcd60e51b815260206004820152601a60248201527f4f7065726174696f6e20616c72656164792065786563757465640000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602660248201527f416d6f756e74206f66207369676e617475726573206973206e6f7420737566666044820152651a58da595b9d60d21b6064820152608490fd5b3461018a57602036600319011261018a5761084261155e565b61084a611631565b6001600160a01b03811660008181526001602052604090205490919060ff166108d0578160005260016020526040600020600160ff1982541617905560025490600160401b8210156102ba576102748260016108a994016002556115d2565b7f784c8f4dbf0ffedd6e72c76501c545a70f8b203b30a26ce542bf92ba87c248a4600080a2005b60405162461bcd60e51b815260206004820152601a60248201527f546f6b656e20697320616c726561647920737570706f727465640000000000006044820152606490fd5b3461018a57600036600319011261018a576007546040516001600160a01b039091168152602090f35b3461018a57600036600319011261018a576020600854604051908152f35b3461018a57602036600319011261018a577ff1c9188ac961e8bd19c50ac88f72f585b190a9af6d3796d2c5cfba24e9ec7a42608060043561099b611631565b6109a9612710821115611c25565b806005556040519081526040602082015260046040820152636c6f636b60e01b6060820152a1005b3461018a57600036600319011261018a576020600654604051908152f35b3461018a57602036600319011261018a57600435610a0b611631565b80151580610a81575b15610a4a576020817f6c4ce60fd690e1216286a10b875c5662555f10774484e58142cedd7a90781baa92600855604051908152a1005b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206b2076616c756560881b6044820152606490fd5b50600454811115610a14565b3461018a57600036600319011261018a57604051600480548083526000918252602080840193927f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b92915b828210610aff57610afb85610aef81890382611760565b604051918291826115ed565b0390f35b83546001600160a01b031686529485019460019384019390910190610ad8565b3461018a57600036600319011261018a576000546040516001600160a01b039091168152602090f35b3461018a57600036600319011261018a57600754336001600160a01b0391821614908115610c13575b5015610bc057610b7f611719565b6000805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b60405162461bcd60e51b815260206004820152602560248201527f4f6e6c79206d756c746973696741646d696e206f72206f776e65722063616e20604482015264706175736560d81b6064820152608490fd5b905060005416331481610b71565b3461018a57600036600319011261018a57604051600280548083526000918252602080840193927f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace92915b828210610c8357610afb85610aef81890382611760565b83546001600160a01b031686529485019460019384019390910190610c6c565b3461018a57602036600319011261018a576004356000526003602052602060ff604060002054166040519015158152f35b3461018a57602036600319011261018a576020610cf7610cf261155e565b611ccc565b6040519015158152f35b3461018a57600036600319011261018a57610d1a611631565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461018a57602036600319011261018a57610d7361155e565b610d7b611631565b6001600160a01b03168015610da057600780546001600160a01b031916919091179055005b60405162461bcd60e51b815260206004820152602960248201527f4d756c74697369672061646d696e2063616e6e6f7420626520746865207a65726044820152686f206164647265737360b81b6064820152608490fd5b3461018a57602036600319011261018a576001600160a01b03610e1861155e565b166000526001602052602060ff604060002054166040519015158152f35b3461018a57602036600319011261018a57610e4f61155e565b610e57611631565b60018060a01b0380911690816000526001908160205260ff6040600020541615610f7b578260005281602052604060002060ff198154169055600280549160005b838110610ec8575b857f4c910b69fe65a61f7531b9c5042b2329ca7179c77290aa7e2eb3afa3c8511fd3600080a2005b8186610ed3836115d2565b929054600393841b1c1614610eea57508401610e98565b929450600019939091848201918211610f6557610f1993610f0d610274936115d2565b9054911b1c16916115d2565b81548015610f4f570190610f44610f2f836115d2565b81549060018060a01b039060031b1b19169055565b558180808080610ea0565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b8152602060048201526016602482015275151bdad95b881a5cc81b9bdd081cdd5c1c1bdc9d195960521b6044820152606490fd5b3461018a57602036600319011261018a577ff1c9188ac961e8bd19c50ac88f72f585b190a9af6d3796d2c5cfba24e9ec7a426080600435610ff8611631565b611006612710821115611c25565b8060065560405190815260406020820152600660408201526572656465656d60d01b6060820152a1005b3461018a57600036600319011261018a57602060ff60005460a01c166040519015158152f35b3461018a57600036600319011261018a576020600554604051908152f35b3461018a57600036600319011261018a5761108d611631565b60005460ff8160a01c16156110d45760ff60a01b19166000556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b3461018a57602036600319011261018a5760043560045481101561018a576111396020916115a1565b905460405160039290921b1c6001600160a01b03168152f35b3461018a57606036600319011261018a576001600160401b0360043560243582811161018a57611186903690600401611574565b6044356001600160a01b03811694929085900361018a576111a5611719565b83156112d4578460005260016020526111c560ff60406000205416611689565b6111cf8282611d17565b15611297576127106111e3600554866116cb565b049285600052600960205260406000206111fe8582546116de565b90556040516323b872dd60e01b60208201523360248201523060448201526064808201879052815260a08101918211818310176102ba577f78a4518c05c7ababe3937649e215d6c585b14a47a7936d03ebf0ec95544d51679461126b61127192611284946040528961179c565b866116eb565b91604051936060855260608501916116f8565b93602083015260408201528033930390a3005b60405162461bcd60e51b8152602060048201526015602482015274496e76616c6964204d61737361206164647265737360581b6044820152606490fd5b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b3461018a5760208060031936011261018a5761133361155e565b6007546001600160a01b03919082163314801561141c575b156113c15760005b6002548110156113bf57808361136a6001936115d2565b90549060031b1c1680600052600986527f9826687c41651ba69cea32ce3452ab6943e1e3df42b47269d3a4b7bb5ddf88078660406000206000815491556113b2818886611a02565b604051908152a201611353565b005b60405162461bcd60e51b815260048101849052602d60248201527f4f6e6c79206d756c746973696741646d696e206f72206f776e65722063616e2060448201526c7769746864726177206665657360981b6064820152608490fd5b508160005416331461134b565b3461018a57602036600319011261018a5761144261155e565b61144a611631565b60045490600854821115611500576001600160a01b03908116919060005b82811061147157005b818461147c836115a1565b929054600393841b1c16146114945750600101611468565b600019939092848201918211610f65576114c0936114b4610274936115a1565b9054911b1c16916115a1565b6004548015610f4f57016114d6610f2f826115a1565b6004557f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b600080a2005b60405162461bcd60e51b815260206004820152603060248201527f4e756d626572206f66207369676e657273206d7573742062652067726561746560448201526f1c881d1a185b881d1a1c995cda1bdb1960821b6064820152608490fd5b600435906001600160a01b038216820361018a57565b9181601f8401121561018a578235916001600160401b03831161018a576020838186019501011161018a57565b6004548110156115bc57600460005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6002548110156115bc57600260005260206000200190600090565b6020908160408183019282815285518094520193019160005b828110611614575050505090565b83516001600160a01b031685529381019392810192600101611606565b6000546001600160a01b0316330361164557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561169057565b60405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd081cdd5c1c1bdc9d1959606a1b6044820152606490fd5b81810292918115918404141715610f6557565b91908201809211610f6557565b91908203918211610f6557565b908060209392818452848401376000828201840152601f01601f1916010190565b60ff60005460a01c1661172857565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b90601f801991011681019081106001600160401b038211176102ba57604052565b6001600160401b0381116102ba57601f01601f191660200190565b60018060a01b03169060405160408101908082106001600160401b038311176102ba5761182b916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af13d156118c8573d9161181083611781565b9261181e6040519485611760565b83523d868885013e6118cc565b80519182159184831561189d575b5050509050156118465750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126118c4578201519081151582036118c1575080388084611839565b80fd5b5080fd5b6060915b9192901561192e57508151156118e0575090565b3b156118e95790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156119415750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611987575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611964565b6001600160401b0381116102ba5760051b60200190565b9291926119c382611781565b916119d16040519384611760565b82948184528183011161018a578281602093846000960137010152565b80518210156115bc5760209160051b010190565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b038311828410176102ba57611a519260405261179c565b565b6005811015611b525780611a645750565b60018103611aac5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b60028103611af95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611b0257565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b906041815114600014611b9657611b92916020820151906060604084015193015160001a90611ba0565b9091565b5050600090600290565b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311611c195791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611c0c5781516001600160a01b03811615611c06579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b15611c2c57565b60405162461bcd60e51b815260206004820152601f60248201527f4665652063616e6e6f742062652067726561746572207468616e2031303025006044820152606490fd5b15611c7857565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b6004549060005b828110611ce257505050600090565b611ceb816115a1565b905460039190911b1c6001600160a01b0390811690831614611d0f57600101611cd3565b505050600190565b611d229136916119b7565b805190602782108015611efc575b611ef55781156115bc57602080820151604160f81b926001600160f81b0319929183168414801590611eb2575b611ea85760025b858110611d7657505050505050600190565b8151811015611e93578383828401015116603160f81b8110159081611e84575b8115611e64575b8115611e40575b8115611e1c575b8115611df8575b8115611dd2575b5015611dc757600101611d64565b505050505050600090565b606d60f81b811015915081611de9575b5038611db9565b603d60f91b1015905038611de2565b9050606160f81b81101580611e0e575b90611db2565b50606b60f81b811115611e08565b9050600560fc1b81101580611e32575b90611dab565b50602d60f91b811115611e2c565b9050602560f91b81101580611e56575b90611da4565b50602760f91b811115611e50565b90508581101580611e76575b90611d9d565b50600960fb1b811115611e70565b603960f81b8111159150611d96565b60246000634e487b7160e01b81526032600452fd5b5050505050600090565b508051600110156115bc576021810180518416605560f81b14159081611ed9575b50611d5d565b90508151600110156115bc57518316605360f81b141538611ed3565b5050600090565b5060408211611d3056fea26469706673582212208c0d3f976fd0f653299bff4ba4e930bec1a6abcfd85f60023b09ab58343359ea64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000db1a35b0c8bb727a8ce5314b4fcca874614138bb000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000004eb0ac1de4ccc47f8fa5312a8face1f0b4154e7b000000000000000000000000239cb55cabb87336c6f8e5277a1fa2cb85fc08060000000000000000000000000e7e92e2ae0e28f04b1288c2b70a52262e9b9eaf000000000000000000000000c70f85ad44c092a8e300a9e4ae34628e96d5149a
-----Decoded View---------------
Arg [0] : initialSigners (address[]): 0x4EB0aC1DE4cCc47f8FA5312A8fACe1f0b4154e7B,0x239Cb55Cabb87336c6F8E5277A1Fa2cb85fC0806,0x0E7E92e2aE0E28F04B1288c2B70A52262E9B9EAF,0xC70F85Ad44C092A8e300A9E4Ae34628E96D5149a
Arg [1] : _multisigAdmin (address): 0xDB1a35B0C8Bb727A8ce5314B4fCCa874614138BB
Arg [2] : _k (uint256): 3
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 000000000000000000000000db1a35b0c8bb727a8ce5314b4fcca874614138bb
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 0000000000000000000000004eb0ac1de4ccc47f8fa5312a8face1f0b4154e7b
Arg [5] : 000000000000000000000000239cb55cabb87336c6f8e5277a1fa2cb85fc0806
Arg [6] : 0000000000000000000000000e7e92e2ae0e28f04b1288c2b70a52262e9b9eaf
Arg [7] : 000000000000000000000000c70f85ad44c092a8e300a9e4ae34628e96d5149a
Loading...
Loading
Loading...
Loading
Net Worth in USD
$123,064.78
Net Worth in ETH
56.21975
Token Allocations
USDC
84.33%
WETH
8.53%
WBTC
5.20%
Others
1.94%
Multichain Portfolio | 33 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.