Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Initialize | 124039810 | 846 days ago | IN | 0 ETH | 0.00002762 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MultiRoundCheckout
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./IVotable.sol";
import "./IDAIPermit.sol";
error VotesNotEqualRoundsLength();
error AmountsNotEqualRoundsLength();
error ExcessAmountSent();
contract MultiRoundCheckout is
OwnableUpgradeable,
PausableUpgradeable,
ReentrancyGuardUpgradeable
{
function initialize() public initializer {
__Ownable_init();
__Pausable_init();
__ReentrancyGuard_init();
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
/**
* vote: votes for multiple rounds at once with ETH.
* votes is a 2d array. first index is the index of the round address in the second param.
*/
function vote(
bytes[][] memory votes,
address[] memory rounds,
uint256[] memory amounts
) public payable nonReentrant whenNotPaused {
if (votes.length != rounds.length) {
revert VotesNotEqualRoundsLength();
}
if (amounts.length != rounds.length) {
revert AmountsNotEqualRoundsLength();
}
// possible previous balance + msg.value
uint256 initialBalance = address(this).balance;
for (uint256 i = 0; i < rounds.length;) {
IVotable round = IVotable(payable(rounds[i]));
round.vote{value: amounts[i]}(votes[i]);
unchecked {
++i;
}
}
if (address(this).balance != initialBalance - msg.value) {
revert ExcessAmountSent();
}
}
/**
* voteERC20Permit: votes for multiple rounds at once with ERC20Permit tokens.
*/
function voteERC20Permit(
bytes[][] memory votes,
address[] memory rounds,
uint256[] memory amounts,
uint256 totalAmount,
address token,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public nonReentrant whenNotPaused {
if (votes.length != rounds.length) {
revert VotesNotEqualRoundsLength();
}
if (amounts.length != rounds.length) {
revert AmountsNotEqualRoundsLength();
}
uint256 initialBalance = IERC20Upgradeable(token).balanceOf(address(this));
try IERC20PermitUpgradeable(token).permit(
msg.sender,
address(this),
totalAmount,
deadline,
v,
r,
s
) {} catch Error (string memory reason) {
if ( IERC20Upgradeable(token).allowance(msg.sender, address(this)) < totalAmount) {
revert(reason);
}
} catch (bytes memory reason) {
if ( IERC20Upgradeable(token).allowance(msg.sender, address(this)) < totalAmount) {
revert(string(reason));
}
}
IERC20Upgradeable(token).transferFrom(msg.sender, address(this), totalAmount);
for (uint256 i = 0; i < rounds.length;) {
IVotable round = IVotable(rounds[i]);
IERC20Upgradeable(token).approve(address(round.votingStrategy()), amounts[i]);
round.vote(votes[i]);
unchecked {
++i;
}
}
if (IERC20Upgradeable(token).balanceOf(address(this)) != initialBalance) {
revert ExcessAmountSent();
}
}
/**
* voteDAIPermit: votes for multiple rounds at once with DAI.
*/
function voteDAIPermit(
bytes[][] memory votes,
address[] memory rounds,
uint256[] memory amounts,
uint256 totalAmount,
address token,
uint256 deadline,
uint256 nonce,
uint8 v,
bytes32 r,
bytes32 s
) public nonReentrant whenNotPaused {
if (votes.length != rounds.length) {
revert VotesNotEqualRoundsLength();
}
if (amounts.length != rounds.length) {
revert AmountsNotEqualRoundsLength();
}
uint256 initialBalance = IERC20Upgradeable(token).balanceOf(address(this));
try IDAIPermit(token).permit(
msg.sender,
address(this),
nonce,
deadline,
true,
v,
r,
s
) {} catch Error (string memory reason) {
if ( IERC20Upgradeable(token).allowance(msg.sender, address(this)) < totalAmount) {
revert(reason);
}
} catch (bytes memory reason) {
if ( IERC20Upgradeable(token).allowance(msg.sender, address(this)) < totalAmount) {
revert(string(reason));
}
}
IERC20Upgradeable(token).transferFrom(msg.sender, address(this), totalAmount);
for (uint256 i = 0; i < rounds.length;) {
IVotable round = IVotable(rounds[i]);
IERC20Upgradeable(token).approve(address(round.votingStrategy()), amounts[i]);
round.vote(votes[i]);
unchecked {
++i;
}
}
if (IERC20Upgradeable(token).balanceOf(address(this)) != initialBalance) {
revert ExcessAmountSent();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_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);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @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.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_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());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// 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 IERC20PermitUpgradeable {
/**
* @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 IERC20Upgradeable {
/**
* @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.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* 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;
import "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.17;
interface IDAIPermit {
function permit(
address holder,
address spender,
uint256 nonce,
uint256 expiry,
bool allowed,
uint8 v,
bytes32 r,
bytes32 s
) external;
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.17;
abstract contract IVotable {
address public votingStrategy;
function vote(bytes[] memory data) external virtual payable;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"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":[],"name":"AmountsNotEqualRoundsLength","type":"error"},{"inputs":[],"name":"ExcessAmountSent","type":"error"},{"inputs":[],"name":"VotesNotEqualRoundsLength","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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":"bytes[][]","name":"votes","type":"bytes[][]"},{"internalType":"address[]","name":"rounds","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"vote","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[][]","name":"votes","type":"bytes[][]"},{"internalType":"address[]","name":"rounds","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"voteDAIPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[][]","name":"votes","type":"bytes[][]"},{"internalType":"address[]","name":"rounds","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"voteERC20Permit","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50611a31806100206000396000f3fe6080604052600436106100915760003560e01c80638da5cb5b116100595780638da5cb5b14610114578063a710f56a1461013c578063aea64c381461015c578063e31739691461016f578063f2fde38b1461018f57600080fd5b80633f4ba83a146100965780635c975abb146100ad578063715018a6146100d55780638129fc1c146100ea5780638456cb59146100ff575b600080fd5b3480156100a257600080fd5b506100ab6101af565b005b3480156100b957600080fd5b5060655460ff1660405190151581526020015b60405180910390f35b3480156100e157600080fd5b506100ab6101c1565b3480156100f657600080fd5b506100ab6101d3565b34801561010b57600080fd5b506100ab6102f9565b34801561012057600080fd5b506033546040516001600160a01b0390911681526020016100cc565b34801561014857600080fd5b506100ab61015736600461156c565b610309565b6100ab61016a36600461163d565b610834565b34801561017b57600080fd5b506100ab61018a3660046116c5565b61098a565b34801561019b57600080fd5b506100ab6101aa3660046117a1565b610ebe565b6101b7610f34565b6101bf610f8e565b565b6101c9610f34565b6101bf6000610fe0565b600054610100900460ff16158080156101f35750600054600160ff909116105b8061020d5750303b15801561020d575060005460ff166001145b6102755760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610298576000805461ff0019166101001790555b6102a0611032565b6102a8611061565b6102b0611090565b80156102f6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610301610f34565b6101bf6110bf565b6103116110fc565b610319611155565b875189511461033b57604051630977d6c560e11b815260040160405180910390fd5b875187511461035d57604051631c9449e160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa1580156103a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c891906117c5565b60405163d505accf60e01b8152336004820152306024820152604481018990526064810187905260ff8616608482015260a4810185905260c481018490529091506001600160a01b0387169063d505accf9060e401600060405180830381600087803b15801561043757600080fd5b505af1925050508015610448575060015b610570576104546117de565b806308c379a00361050a57506104686117fa565b80610473575061050c565b604051636eb1769f60e11b815233600482015230602482015288906001600160a01b0389169063dd62ed3e906044015b602060405180830381865afa1580156104c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e491906117c5565b1015610504578060405162461bcd60e51b815260040161026c91906118bf565b50610570565b505b3d808015610536576040519150601f19603f3d011682016040523d82523d6000602084013e61053b565b606091505b50604051636eb1769f60e11b815233600482015230602482015288906001600160a01b0389169063dd62ed3e906044016104a3565b6040516323b872dd60e01b8152336004820152306024820152604481018890526001600160a01b038716906323b872dd906064016020604051808303816000875af11580156105c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e791906118d2565b5060005b89518110156107955760008a8281518110610608576106086118f4565b60200260200101519050876001600160a01b031663095ea7b3826001600160a01b031663fb5c8bfd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561065f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610683919061190a565b8c8581518110610695576106956118f4565b60200260200101516040518363ffffffff1660e01b81526004016106ce9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af11580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071191906118d2565b50806001600160a01b0316637aa54b688d8481518110610733576107336118f4565b60200260200101516040518263ffffffff1660e01b81526004016107579190611927565b600060405180830381600087803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b50505050816001019150506105eb565b506040516370a0823160e01b815230600482015281906001600160a01b038816906370a0823190602401602060405180830381865afa1580156107dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080091906117c5565b1461081e576040516367832fe760e01b815260040160405180910390fd5b506108296001609755565b505050505050505050565b61083c6110fc565b610844611155565b815183511461086657604051630977d6c560e11b815260040160405180910390fd5b815181511461088857604051631c9449e160e01b815260040160405180910390fd5b4760005b83518110156109505760008482815181106108a9576108a96118f4565b60200260200101519050806001600160a01b0316637aa54b688584815181106108d4576108d46118f4565b60200260200101518885815181106108ee576108ee6118f4565b60200260200101516040518363ffffffff1660e01b81526004016109129190611927565b6000604051808303818588803b15801561092b57600080fd5b505af115801561093f573d6000803e3d6000fd5b50505050508160010191505061088c565b5061095b3482611989565b471461097a576040516367832fe760e01b815260040160405180910390fd5b506109856001609755565b505050565b6109926110fc565b61099a611155565b88518a51146109bc57604051630977d6c560e11b815260040160405180910390fd5b88518851146109de57604051631c9449e160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4991906117c5565b6040516323f2ebc360e21b815233600482015230602482015260448101879052606481018890526001608482015260ff861660a482015260c4810185905260e481018490529091506001600160a01b03881690638fcbaf0c9061010401600060405180830381600087803b158015610ac057600080fd5b505af1925050508015610ad1575060015b610bf957610add6117de565b806308c379a003610b935750610af16117fa565b80610afc5750610b95565b604051636eb1769f60e11b815233600482015230602482015289906001600160a01b038a169063dd62ed3e906044015b602060405180830381865afa158015610b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6d91906117c5565b1015610b8d578060405162461bcd60e51b815260040161026c91906118bf565b50610bf9565b505b3d808015610bbf576040519150601f19603f3d011682016040523d82523d6000602084013e610bc4565b606091505b50604051636eb1769f60e11b815233600482015230602482015289906001600160a01b038a169063dd62ed3e90604401610b2c565b6040516323b872dd60e01b8152336004820152306024820152604481018990526001600160a01b038816906323b872dd906064016020604051808303816000875af1158015610c4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7091906118d2565b5060005b8a51811015610e1e5760008b8281518110610c9157610c916118f4565b60200260200101519050886001600160a01b031663095ea7b3826001600160a01b031663fb5c8bfd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c919061190a565b8d8581518110610d1e57610d1e6118f4565b60200260200101516040518363ffffffff1660e01b8152600401610d579291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015610d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9a91906118d2565b50806001600160a01b0316637aa54b688e8481518110610dbc57610dbc6118f4565b60200260200101516040518263ffffffff1660e01b8152600401610de09190611927565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505081600101915050610c74565b506040516370a0823160e01b815230600482015281906001600160a01b038916906370a0823190602401602060405180830381865afa158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8991906117c5565b14610ea7576040516367832fe760e01b815260040160405180910390fd5b50610eb26001609755565b50505050505050505050565b610ec6610f34565b6001600160a01b038116610f2b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026c565b6102f681610fe0565b6033546001600160a01b031633146101bf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b610f966111a2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166110595760405162461bcd60e51b815260040161026c906119b0565b6101bf6111eb565b600054610100900460ff166110885760405162461bcd60e51b815260040161026c906119b0565b6101bf61121b565b600054610100900460ff166110b75760405162461bcd60e51b815260040161026c906119b0565b6101bf61124e565b6110c7611155565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fc33390565b60026097540361114e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026c565b6002609755565b60655460ff16156101bf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161026c565b6001609755565b60655460ff166101bf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161026c565b600054610100900460ff166112125760405162461bcd60e51b815260040161026c906119b0565b6101bf33610fe0565b600054610100900460ff166112425760405162461bcd60e51b815260040161026c906119b0565b6065805460ff19169055565b600054610100900460ff1661119b5760405162461bcd60e51b815260040161026c906119b0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156112b1576112b1611275565b6040525050565b600067ffffffffffffffff8211156112d2576112d2611275565b5060051b60200190565b600082601f8301126112ed57600080fd5b6112f782356112b8565b604051611304828261128b565b83358082526020808301935060059190911b8501018581111561132657600080fd5b602085015b8181101561144b5767ffffffffffffffff808235111561134a57600080fd5b8135870188603f82011261135d57600080fd5b602081013561136b816112b8565b604051611378828261128b565b82815260059290921b8301604001916020810191508b83111561139a57600080fd5b604084015b838110156114335785813511156113b557600080fd5b803585018d605f8201126113c857600080fd5b6040810135878111156113dd576113dd611275565b6040516113f4601f8301601f19166020018261128b565b8181528f606083850101111561140957600080fd5b8160608401602083013760006020838301015280865250505060208301925060208101905061139f565b508852505060209586019592909201915061132b9050565b509095945050505050565b6001600160a01b03811681146102f657600080fd5b803561147681611456565b919050565b600082601f83011261148c57600080fd5b81356020611499826112b8565b6040516114a6828261128b565b83815260059390931b85018201928281019150868411156114c657600080fd5b8286015b848110156114ea5780356114dd81611456565b83529183019183016114ca565b509695505050505050565b600082601f83011261150657600080fd5b81356020611513826112b8565b604051611520828261128b565b83815260059390931b850182019282810191508684111561154057600080fd5b8286015b848110156114ea5780358352918301918301611544565b803560ff8116811461147657600080fd5b60008060008060008060008060006101208a8c03121561158b57600080fd5b893567ffffffffffffffff808211156115a357600080fd5b6115af8d838e016112dc565b9a5060208c01359150808211156115c557600080fd5b6115d18d838e0161147b565b995060408c01359150808211156115e757600080fd5b506115f48c828d016114f5565b97505060608a0135955061160a60808b0161146b565b945060a08a0135935061161f60c08b0161155b565b925060e08a013591506101008a013590509295985092959850929598565b60008060006060848603121561165257600080fd5b833567ffffffffffffffff8082111561166a57600080fd5b611676878388016112dc565b9450602086013591508082111561168c57600080fd5b6116988783880161147b565b935060408601359150808211156116ae57600080fd5b506116bb868287016114f5565b9150509250925092565b6000806000806000806000806000806101408b8d0312156116e557600080fd5b8a3567ffffffffffffffff808211156116fd57600080fd5b6117098e838f016112dc565b9b5060208d013591508082111561171f57600080fd5b61172b8e838f0161147b565b9a5060408d013591508082111561174157600080fd5b5061174e8d828e016114f5565b98505060608b0135965061176460808c0161146b565b955060a08b0135945060c08b0135935061178060e08c0161155b565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000602082840312156117b357600080fd5b81356117be81611456565b9392505050565b6000602082840312156117d757600080fd5b5051919050565b600060033d11156117f75760046000803e5060005160e01c5b90565b600060443d10156118085790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561183857505050505090565b82850191508151818111156118505750505050505090565b843d870101602082850101111561186a5750505050505090565b61144b6020828601018761128b565b6000815180845260005b8181101561189f57602081850181015186830182015201611883565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006117be6020830184611879565b6000602082840312156118e457600080fd5b815180151581146117be57600080fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561191c57600080fd5b81516117be81611456565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561197c57603f1988860301845261196a858351611879565b9450928501929085019060010161194e565b5092979650505050505050565b818103818111156119aa57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122007ea0cb352ce537089b09a519b13572402634948c5743975cf94ab5c1b08eaf064736f6c63430008120033
Deployed Bytecode
0x6080604052600436106100915760003560e01c80638da5cb5b116100595780638da5cb5b14610114578063a710f56a1461013c578063aea64c381461015c578063e31739691461016f578063f2fde38b1461018f57600080fd5b80633f4ba83a146100965780635c975abb146100ad578063715018a6146100d55780638129fc1c146100ea5780638456cb59146100ff575b600080fd5b3480156100a257600080fd5b506100ab6101af565b005b3480156100b957600080fd5b5060655460ff1660405190151581526020015b60405180910390f35b3480156100e157600080fd5b506100ab6101c1565b3480156100f657600080fd5b506100ab6101d3565b34801561010b57600080fd5b506100ab6102f9565b34801561012057600080fd5b506033546040516001600160a01b0390911681526020016100cc565b34801561014857600080fd5b506100ab61015736600461156c565b610309565b6100ab61016a36600461163d565b610834565b34801561017b57600080fd5b506100ab61018a3660046116c5565b61098a565b34801561019b57600080fd5b506100ab6101aa3660046117a1565b610ebe565b6101b7610f34565b6101bf610f8e565b565b6101c9610f34565b6101bf6000610fe0565b600054610100900460ff16158080156101f35750600054600160ff909116105b8061020d5750303b15801561020d575060005460ff166001145b6102755760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610298576000805461ff0019166101001790555b6102a0611032565b6102a8611061565b6102b0611090565b80156102f6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610301610f34565b6101bf6110bf565b6103116110fc565b610319611155565b875189511461033b57604051630977d6c560e11b815260040160405180910390fd5b875187511461035d57604051631c9449e160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa1580156103a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c891906117c5565b60405163d505accf60e01b8152336004820152306024820152604481018990526064810187905260ff8616608482015260a4810185905260c481018490529091506001600160a01b0387169063d505accf9060e401600060405180830381600087803b15801561043757600080fd5b505af1925050508015610448575060015b610570576104546117de565b806308c379a00361050a57506104686117fa565b80610473575061050c565b604051636eb1769f60e11b815233600482015230602482015288906001600160a01b0389169063dd62ed3e906044015b602060405180830381865afa1580156104c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e491906117c5565b1015610504578060405162461bcd60e51b815260040161026c91906118bf565b50610570565b505b3d808015610536576040519150601f19603f3d011682016040523d82523d6000602084013e61053b565b606091505b50604051636eb1769f60e11b815233600482015230602482015288906001600160a01b0389169063dd62ed3e906044016104a3565b6040516323b872dd60e01b8152336004820152306024820152604481018890526001600160a01b038716906323b872dd906064016020604051808303816000875af11580156105c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e791906118d2565b5060005b89518110156107955760008a8281518110610608576106086118f4565b60200260200101519050876001600160a01b031663095ea7b3826001600160a01b031663fb5c8bfd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561065f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610683919061190a565b8c8581518110610695576106956118f4565b60200260200101516040518363ffffffff1660e01b81526004016106ce9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af11580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071191906118d2565b50806001600160a01b0316637aa54b688d8481518110610733576107336118f4565b60200260200101516040518263ffffffff1660e01b81526004016107579190611927565b600060405180830381600087803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b50505050816001019150506105eb565b506040516370a0823160e01b815230600482015281906001600160a01b038816906370a0823190602401602060405180830381865afa1580156107dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080091906117c5565b1461081e576040516367832fe760e01b815260040160405180910390fd5b506108296001609755565b505050505050505050565b61083c6110fc565b610844611155565b815183511461086657604051630977d6c560e11b815260040160405180910390fd5b815181511461088857604051631c9449e160e01b815260040160405180910390fd5b4760005b83518110156109505760008482815181106108a9576108a96118f4565b60200260200101519050806001600160a01b0316637aa54b688584815181106108d4576108d46118f4565b60200260200101518885815181106108ee576108ee6118f4565b60200260200101516040518363ffffffff1660e01b81526004016109129190611927565b6000604051808303818588803b15801561092b57600080fd5b505af115801561093f573d6000803e3d6000fd5b50505050508160010191505061088c565b5061095b3482611989565b471461097a576040516367832fe760e01b815260040160405180910390fd5b506109856001609755565b505050565b6109926110fc565b61099a611155565b88518a51146109bc57604051630977d6c560e11b815260040160405180910390fd5b88518851146109de57604051631c9449e160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4991906117c5565b6040516323f2ebc360e21b815233600482015230602482015260448101879052606481018890526001608482015260ff861660a482015260c4810185905260e481018490529091506001600160a01b03881690638fcbaf0c9061010401600060405180830381600087803b158015610ac057600080fd5b505af1925050508015610ad1575060015b610bf957610add6117de565b806308c379a003610b935750610af16117fa565b80610afc5750610b95565b604051636eb1769f60e11b815233600482015230602482015289906001600160a01b038a169063dd62ed3e906044015b602060405180830381865afa158015610b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6d91906117c5565b1015610b8d578060405162461bcd60e51b815260040161026c91906118bf565b50610bf9565b505b3d808015610bbf576040519150601f19603f3d011682016040523d82523d6000602084013e610bc4565b606091505b50604051636eb1769f60e11b815233600482015230602482015289906001600160a01b038a169063dd62ed3e90604401610b2c565b6040516323b872dd60e01b8152336004820152306024820152604481018990526001600160a01b038816906323b872dd906064016020604051808303816000875af1158015610c4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7091906118d2565b5060005b8a51811015610e1e5760008b8281518110610c9157610c916118f4565b60200260200101519050886001600160a01b031663095ea7b3826001600160a01b031663fb5c8bfd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c919061190a565b8d8581518110610d1e57610d1e6118f4565b60200260200101516040518363ffffffff1660e01b8152600401610d579291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015610d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9a91906118d2565b50806001600160a01b0316637aa54b688e8481518110610dbc57610dbc6118f4565b60200260200101516040518263ffffffff1660e01b8152600401610de09190611927565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505081600101915050610c74565b506040516370a0823160e01b815230600482015281906001600160a01b038916906370a0823190602401602060405180830381865afa158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8991906117c5565b14610ea7576040516367832fe760e01b815260040160405180910390fd5b50610eb26001609755565b50505050505050505050565b610ec6610f34565b6001600160a01b038116610f2b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026c565b6102f681610fe0565b6033546001600160a01b031633146101bf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b610f966111a2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166110595760405162461bcd60e51b815260040161026c906119b0565b6101bf6111eb565b600054610100900460ff166110885760405162461bcd60e51b815260040161026c906119b0565b6101bf61121b565b600054610100900460ff166110b75760405162461bcd60e51b815260040161026c906119b0565b6101bf61124e565b6110c7611155565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fc33390565b60026097540361114e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026c565b6002609755565b60655460ff16156101bf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161026c565b6001609755565b60655460ff166101bf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161026c565b600054610100900460ff166112125760405162461bcd60e51b815260040161026c906119b0565b6101bf33610fe0565b600054610100900460ff166112425760405162461bcd60e51b815260040161026c906119b0565b6065805460ff19169055565b600054610100900460ff1661119b5760405162461bcd60e51b815260040161026c906119b0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156112b1576112b1611275565b6040525050565b600067ffffffffffffffff8211156112d2576112d2611275565b5060051b60200190565b600082601f8301126112ed57600080fd5b6112f782356112b8565b604051611304828261128b565b83358082526020808301935060059190911b8501018581111561132657600080fd5b602085015b8181101561144b5767ffffffffffffffff808235111561134a57600080fd5b8135870188603f82011261135d57600080fd5b602081013561136b816112b8565b604051611378828261128b565b82815260059290921b8301604001916020810191508b83111561139a57600080fd5b604084015b838110156114335785813511156113b557600080fd5b803585018d605f8201126113c857600080fd5b6040810135878111156113dd576113dd611275565b6040516113f4601f8301601f19166020018261128b565b8181528f606083850101111561140957600080fd5b8160608401602083013760006020838301015280865250505060208301925060208101905061139f565b508852505060209586019592909201915061132b9050565b509095945050505050565b6001600160a01b03811681146102f657600080fd5b803561147681611456565b919050565b600082601f83011261148c57600080fd5b81356020611499826112b8565b6040516114a6828261128b565b83815260059390931b85018201928281019150868411156114c657600080fd5b8286015b848110156114ea5780356114dd81611456565b83529183019183016114ca565b509695505050505050565b600082601f83011261150657600080fd5b81356020611513826112b8565b604051611520828261128b565b83815260059390931b850182019282810191508684111561154057600080fd5b8286015b848110156114ea5780358352918301918301611544565b803560ff8116811461147657600080fd5b60008060008060008060008060006101208a8c03121561158b57600080fd5b893567ffffffffffffffff808211156115a357600080fd5b6115af8d838e016112dc565b9a5060208c01359150808211156115c557600080fd5b6115d18d838e0161147b565b995060408c01359150808211156115e757600080fd5b506115f48c828d016114f5565b97505060608a0135955061160a60808b0161146b565b945060a08a0135935061161f60c08b0161155b565b925060e08a013591506101008a013590509295985092959850929598565b60008060006060848603121561165257600080fd5b833567ffffffffffffffff8082111561166a57600080fd5b611676878388016112dc565b9450602086013591508082111561168c57600080fd5b6116988783880161147b565b935060408601359150808211156116ae57600080fd5b506116bb868287016114f5565b9150509250925092565b6000806000806000806000806000806101408b8d0312156116e557600080fd5b8a3567ffffffffffffffff808211156116fd57600080fd5b6117098e838f016112dc565b9b5060208d013591508082111561171f57600080fd5b61172b8e838f0161147b565b9a5060408d013591508082111561174157600080fd5b5061174e8d828e016114f5565b98505060608b0135965061176460808c0161146b565b955060a08b0135945060c08b0135935061178060e08c0161155b565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000602082840312156117b357600080fd5b81356117be81611456565b9392505050565b6000602082840312156117d757600080fd5b5051919050565b600060033d11156117f75760046000803e5060005160e01c5b90565b600060443d10156118085790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561183857505050505090565b82850191508151818111156118505750505050505090565b843d870101602082850101111561186a5750505050505090565b61144b6020828601018761128b565b6000815180845260005b8181101561189f57602081850181015186830182015201611883565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006117be6020830184611879565b6000602082840312156118e457600080fd5b815180151581146117be57600080fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561191c57600080fd5b81516117be81611456565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561197c57603f1988860301845261196a858351611879565b9450928501929085019060010161194e565b5092979650505050505050565b818103818111156119aa57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122007ea0cb352ce537089b09a519b13572402634948c5743975cf94ab5c1b08eaf064736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.