Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
C12DAO
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract C12DAO is Initializable, ERC1155HolderUpgradeable {
address public DAONFT;
address public owner;
bool public pauseDao;
uint16 public proposalId;
enum Status { Open, Closed, Cancelled }
struct Proposal {
uint16 id;
address author;
string proposalHash;
uint createdAt;
uint[] votes;
string[] options;
Status status;
string selectedOption;
mapping(address=>bool) voted;
}
uint256[] public votingWeights;
mapping (uint => Proposal) public proposals;
event ProposalCreated(uint proposalId, address author, uint createdAt);
event voteCast(uint proposalId, address voter, uint weight, uint timestamp);
// modifier onlyAdvisorOrF12() {
// require(containsToken(msg.sender, 0) || containsToken(msg.sender, 1),"C12DAO: Not Holding Advisor or F12 Token");
// _;
// }
modifier onlyOwner() {
require(msg.sender == owner,"Error: Caller Must be Ownable!");
_;
}
modifier onlyF12() {
require(containsToken(msg.sender,0), "C12DAO: Not holding F12 Token");
_;
}
function initialize() public initializer {
__ERC1155Holder_init();
owner = msg.sender;
DAONFT = address(0x82BeEc866ae3A1a5FC1f8bB7A3DCCD17E223C949);
votingWeights = [300,100,1];
}
// @title createProposal
// @dev Creates a new proposal
// @param proposalHash - Hash of the proposal string
// @param options - Array of options as strings. Eg. ["Yes", "No", "No Preference", "Strongly Opposed"]
// @dev Only available to advisors and F12 members, as determined by the onlyF12 modifier
function createProposal(string memory proposalHash, string[] memory options) public onlyF12 {
uint[] memory votes = new uint[](options.length);
proposalId++;
proposals[proposalId].id = proposalId;
proposals[proposalId].author = msg.sender;
proposals[proposalId].proposalHash = proposalHash;
proposals[proposalId].createdAt = block.timestamp;
proposals[proposalId].votes = votes;
proposals[proposalId].options = options;
proposals[proposalId].status = Status.Open;
emit ProposalCreated(proposalId, msg.sender, block.timestamp);
}
function castVote(uint _proposalId, uint option) public {
require(!pauseDao,"C12DAO: Voting Paused!");
Proposal storage proposal = proposals[_proposalId];
require(proposal.status == Status.Open,"C12DAO: Proposal Already Evaluated!");
require(proposal.voted[msg.sender]==false, "C12DAO: Already Voted");
proposal.voted[msg.sender] = true;
uint votingWeight = getVotingWeight(msg.sender);
proposal.votes[option] += votingWeight;
emit voteCast( _proposalId, msg.sender, votingWeight, block.timestamp);
}
function evaluateProposal(uint _proposalId) public onlyF12 {
Proposal storage proposal = proposals[_proposalId];
require(proposal.status == Status.Open,"C12DAO: Proposal Already Evaluated!");
uint[] memory votes = proposal.votes;
uint maxVotes = 0;
uint maxVotesIndex = 0;
for(uint i = 0; i < proposal.options.length; i++){
if(votes[i] > maxVotes) {
maxVotes = votes[i];
maxVotesIndex = i;
}
}
proposal.selectedOption = proposal.options[maxVotesIndex];
proposal.status = Status.Closed;
}
function cancelProposal(uint _proposalId) public onlyF12 {
Proposal storage proposal = proposals[_proposalId];
require(proposal.status == Status.Open,"C12DAO: Proposal Already Evaluated!");
proposal.status = Status.Cancelled;
}
function getVotingWeight(address voter) public view returns(uint) {
uint votingWeight = 0;
IERC1155 NFT = IERC1155(DAONFT);
for(uint i=0; i<votingWeights.length; i++) {
votingWeight += votingWeights[i] * NFT.balanceOf(voter, i);
}
return votingWeight;
}
function containsToken(address addr, uint id) internal view returns (bool) {
IERC1155 NFT = IERC1155(DAONFT);
return (NFT.balanceOf(addr, id) > 0);
}
function setVotingWeight(uint32[] calldata newVotingWeights) public onlyF12 {
votingWeights = newVotingWeights;
}
function disableVoting(bool _status) public onlyF12 {
pauseDao = _status;
}
function setNft(address _nft) public onlyOwner() {
DAONFT = _nft;
}
function rescueNft1155(address _token,uint _id) public onlyF12 {
uint balance = IERC1155(_token).balanceOf(address(this), _id);
IERC1155(_token).safeTransferFrom(address(this), msg.sender, _id, balance, "");
}
function rescueToken(address _token) public onlyF12 {
uint balance = IERC20(_token).balanceOf(address(this));
IERC20(_token).transfer(msg.sender, balance);
}
function rescueFunds() public onlyF12 {
(bool os,) = payable(msg.sender).call{value: address(this).balance}("");
require(os,"Transaction Failed!");
}
// The following functions are overrides required by Solidity.
function supportsInterface(bytes4 interfaceId)
public
view
override (ERC1155ReceiverUpgradeable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
function getVotingWeightLength() public view returns (uint256) {
return votingWeights.length;
}
function getPower() public view returns (uint256[] memory) {
return votingWeights;
}
function getProposalOptions(uint ids) public view returns (string[] memory) {
return proposals[ids].options;
}
function getProposalVotes(uint ids) public view returns (uint[] memory) {
return proposals[ids].votes;
}
function getProposalUserVote(uint ids,address _user) public view returns (bool) {
return proposals[ids].voted[_user];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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]
* ```
* 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 Internal function that returns the initialized version. Returns `_initialized`
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Internal function that returns the initialized version. Returns `_initializing`
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
import "./ERC1155ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
*
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
* stuck.
*
* @dev _Available since v3.1._
*/
contract ERC1155HolderUpgradeable is Initializable, ERC1155ReceiverUpgradeable {
function __ERC1155Holder_init() internal onlyInitializing {
}
function __ERC1155Holder_init_unchained() internal onlyInitializing {
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
/**
* @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: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../IERC1155ReceiverUpgradeable.sol";
import "../../../utils/introspection/ERC165Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155ReceiverUpgradeable is Initializable, ERC165Upgradeable, IERC1155ReceiverUpgradeable {
function __ERC1155Receiver_init() internal onlyInitializing {
}
function __ERC1155Receiver_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return interfaceId == type(IERC1155ReceiverUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev 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/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"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[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":false,"internalType":"address","name":"author","type":"address"},{"indexed":false,"internalType":"uint256","name":"createdAt","type":"uint256"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"voteCast","type":"event"},{"inputs":[],"name":"DAONFT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalId","type":"uint256"}],"name":"cancelProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalId","type":"uint256"},{"internalType":"uint256","name":"option","type":"uint256"}],"name":"castVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"proposalHash","type":"string"},{"internalType":"string[]","name":"options","type":"string[]"}],"name":"createProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"disableVoting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalId","type":"uint256"}],"name":"evaluateProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPower","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ids","type":"uint256"}],"name":"getProposalOptions","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ids","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"getProposalUserVote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ids","type":"uint256"}],"name":"getProposalVotes","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"voter","type":"address"}],"name":"getVotingWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVotingWeightLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseDao","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposalId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"proposals","outputs":[{"internalType":"uint16","name":"id","type":"uint16"},{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"proposalHash","type":"string"},{"internalType":"uint256","name":"createdAt","type":"uint256"},{"internalType":"enum C12DAO.Status","name":"status","type":"uint8"},{"internalType":"string","name":"selectedOption","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"rescueNft1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"rescueToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"}],"name":"setNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"newVotingWeights","type":"uint32[]"}],"name":"setVotingWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"votingWeights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50611fad806100206000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063cf83ea7511610097578063e6b2603b11610071578063e6b2603b146103f1578063f23a6e61146103f9578063f3c1338714610418578063fbe56e641461042b57600080fd5b8063cf83ea75146103b8578063d5da24b9146103cb578063e0a8f6f5146103de57600080fd5b80638da5cb5b146102ee578063a1bd71b914610319578063b2fd60e114610339578063bc0904fb1461034c578063bc197c811461035f578063c276cd131461039757600080fd5b806347c661401161014b5780636ca91202116101255780636ca91202146102ad57806376bfd86d146102c05780638129fc1c146102d3578063870cb44f146102db57600080fd5b806347c661401461027157806349a4e50d1461029157806365894f621461029957600080fd5b8063013cf08b1461019357806301ffc9a7146101c15780630ad1a1ca146101e45780632c0a3f89146102215780632dfca445146102365780634460d3cf1461025e575b600080fd5b6101a66101a13660046115d8565b610433565b6040516101b89695949392919061164d565b60405180910390f35b6101d46101cf3660046116c4565b610590565b60405190151581526020016101b8565b6101d46101f2366004611711565b6000828152609a602090815260408083206001600160a01b038516845260070190915290205460ff1692915050565b61023461022f36600461173d565b6105a1565b005b60985461024b90600160a81b900461ffff1681565b60405161ffff90911681526020016101b8565b61023461026c36600461175f565b610740565b61028461027f3660046115d8565b61084b565b6040516101b8919061177a565b6102846108b0565b6098546101d490600160a01b900460ff1681565b6102346102bb366004611899565b610908565b6102346102ce366004611973565b610b1d565b610234610b50565b6102346102e93660046119e8565b610cc3565b609854610301906001600160a01b031681565b6040516001600160a01b0390911681526020016101b8565b61032c6103273660046115d8565b610ddd565b6040516101b89190611a12565b610234610347366004611a82565b610ecc565b609754610301906001600160a01b031681565b61037e61036d366004611b05565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101b8565b6103aa6103a53660046115d8565b610f11565b6040519081526020016101b8565b6102346103c63660046115d8565b610f32565b6103aa6103d936600461175f565b61109f565b6102346103ec3660046115d8565b61117a565b6102346111f7565b61037e610407366004611baf565b63f23a6e6160e01b95945050505050565b61023461042636600461175f565b6112ac565b6099546103aa565b609a602052600090815260409020805460018201805461ffff831693620100009093046001600160a01b031692919061046b90611c14565b80601f016020809104026020016040519081016040528092919081815260200182805461049790611c14565b80156104e45780601f106104b9576101008083540402835291602001916104e4565b820191906000526020600020905b8154815290600101906020018083116104c757829003601f168201915b50505050600283015460058401546006850180549495929460ff90921693509061050d90611c14565b80601f016020809104026020016040519081016040528092919081815260200182805461053990611c14565b80156105865780601f1061055b57610100808354040283529160200191610586565b820191906000526020600020905b81548152906001019060200180831161056957829003601f168201915b5050505050905086565b600061059b82611328565b92915050565b609854600160a01b900460ff16156105f95760405162461bcd60e51b815260206004820152601660248201527543313244414f3a20566f74696e67205061757365642160501b60448201526064015b60405180910390fd5b6000828152609a6020526040812090600582015460ff16600281111561062157610621611637565b1461063e5760405162461bcd60e51b81526004016105f090611c4e565b33600090815260078201602052604090205460ff16156106985760405162461bcd60e51b815260206004820152601560248201527410cc4c911053ce88105b1c9958591e48159bdd1959605a1b60448201526064016105f0565b3360008181526007830160205260408120805460ff19166001179055906106be9061109f565b9050808260030184815481106106d6576106d6611c91565b9060005260206000200160008282546106ef9190611cbd565b9091555050604080518581523360208201529081018290524260608201527f5bc338776aba01d0ac689e3f642138ebe3c5f3355c0723c81c07ffab8061591c9060800160405180910390a150505050565b61074b33600061135d565b6107675760405162461bcd60e51b81526004016105f090611cd0565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190611d07565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190611d20565b505050565b6000818152609a60209081526040918290206003018054835181840281018401909452808452606093928301828280156108a457602002820191906000526020600020905b815481526020019060010190808311610890575b50505050509050919050565b606060998054806020026020016040519081016040528092919081815260200182805480156108fe57602002820191906000526020600020905b8154815260200190600101908083116108ea575b5050505050905090565b61091333600061135d565b61092f5760405162461bcd60e51b81526004016105f090611cd0565b6000815167ffffffffffffffff81111561094b5761094b6117be565b604051908082528060200260200182016040528015610974578160200160208202803683370190505b5060988054919250600160a81b90910461ffff1690601561099483611d3d565b82546101009290920a61ffff81810219909316918316021790915560988054600160a81b9081900483166000818152609a6020526040808220805461ffff1916909317909255835483900485168152818120805462010000600160b01b0319163362010000021790559254919091049092168152206001019050610a188482611dac565b506098805461ffff600160a81b9182900481166000908152609a60209081526040808320426002909101559454939093049091168152919091208251610a669260039092019184019061144b565b50609854600160a81b900461ffff166000908152609a602090815260409091208351610a9a92600490920191850190611496565b50609854600160a81b900461ffff166000908152609a60205260408120600501805460ff191660018302179055506098546040805161ffff600160a81b90930492909216825233602083015242908201527f3417b456fad6209c73445d5efd446d686e75e4560f0f50c13b5a5cde976447b49060600160405180910390a1505050565b610b2833600061135d565b610b445760405162461bcd60e51b81526004016105f090611cd0565b610846609983836114e8565b600054610100900460ff1615808015610b705750600054600160ff909116105b80610b8a5750303b158015610b8a575060005460ff166001145b610bed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105f0565b6000805460ff191660011790558015610c10576000805461ff0019166101001790555b610c186113de565b609880546001600160a01b03199081163317909155609780549091167382beec866ae3a1a5fc1f8bb7a3dccd17e223c9491790556040805160608101825261012c815260646020820152600191810191909152610c7990609990600361152b565b508015610cc0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610cce33600061135d565b610cea5760405162461bcd60e51b81526004016105f090611cd0565b604051627eeac760e11b8152306004820152602481018290526000906001600160a01b0384169062fdd58e90604401602060405180830381865afa158015610d36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5a9190611d07565b604051637921219560e11b8152306004820152336024820152604481018490526064810182905260a06084820152600060a48201529091506001600160a01b0384169063f242432a9060c401600060405180830381600087803b158015610dc057600080fd5b505af1158015610dd4573d6000803e3d6000fd5b50505050505050565b6060609a6000838152602001908152602001600020600401805480602002602001604051908101604052809291908181526020016000905b82821015610ec1578382906000526020600020018054610e3490611c14565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6090611c14565b8015610ead5780601f10610e8257610100808354040283529160200191610ead565b820191906000526020600020905b815481529060010190602001808311610e9057829003601f168201915b505050505081526020019060010190610e15565b505050509050919050565b610ed733600061135d565b610ef35760405162461bcd60e51b81526004016105f090611cd0565b60988054911515600160a01b0260ff60a01b19909216919091179055565b60998181548110610f2157600080fd5b600091825260209091200154905081565b610f3d33600061135d565b610f595760405162461bcd60e51b81526004016105f090611cd0565b6000818152609a6020526040812090600582015460ff166002811115610f8157610f81611637565b14610f9e5760405162461bcd60e51b81526004016105f090611c4e565b600081600301805480602002602001604051908101604052809291908181526020018280548015610fee57602002820191906000526020600020905b815481526020019060010190808311610fda575b5050505050905060008060005b600485015481101561105a578284828151811061101a5761101a611c91565b602002602001015111156110485783818151811061103a5761103a611c91565b602002602001015192508091505b8061105281611e6c565b915050610ffb565b5083600401818154811061107057611070611c91565b9060005260206000200184600601908161108a9190611e85565b50505050600501805460ff1916600117905550565b60975460009081906001600160a01b0316815b60995481101561117157604051627eeac760e11b81526001600160a01b0386811660048301526024820183905283169062fdd58e90604401602060405180830381865afa158015611107573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112b9190611d07565b6099828154811061113e5761113e611c91565b90600052602060002001546111539190611f60565b61115d9084611cbd565b92508061116981611e6c565b9150506110b2565b50909392505050565b61118533600061135d565b6111a15760405162461bcd60e51b81526004016105f090611cd0565b6000818152609a6020526040812090600582015460ff1660028111156111c9576111c9611637565b146111e65760405162461bcd60e51b81526004016105f090611c4e565b600501805460ff1916600217905550565b61120233600061135d565b61121e5760405162461bcd60e51b81526004016105f090611cd0565b604051600090339047908381818185875af1925050503d8060008114611260576040519150601f19603f3d011682016040523d82523d6000602084013e611265565b606091505b5050905080610cc05760405162461bcd60e51b81526020600482015260136024820152725472616e73616374696f6e204661696c65642160681b60448201526064016105f0565b6098546001600160a01b031633146113065760405162461bcd60e51b815260206004820152601e60248201527f4572726f723a2043616c6c6572204d757374206265204f776e61626c6521000060448201526064016105f0565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216630271189760e51b148061059b57506301ffc9a760e01b6001600160e01b031983161461059b565b609754604051627eeac760e11b81526001600160a01b0384811660048301526024820184905260009216908290829062fdd58e90604401602060405180830381865afa1580156113b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d59190611d07565b11949350505050565b600054610100900460ff166114495760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016105f0565b565b828054828255906000526020600020908101928215611486579160200282015b8281111561148657825182559160200191906001019061146b565b5061149292915061156c565b5090565b8280548282559060005260206000209081019282156114dc579160200282015b828111156114dc57825182906114cc9082611dac565b50916020019190600101906114b6565b50611492929150611581565b828054828255906000526020600020908101928215611486579160200282015b828111156114865763ffffffff8335168255602090920191600190910190611508565b828054828255906000526020600020908101928215611486579160200282015b82811115611486578251829061ffff1690559160200191906001019061154b565b5b80821115611492576000815560010161156d565b80821115611492576000611595828261159e565b50600101611581565b5080546115aa90611c14565b6000825580601f106115ba575050565b601f016020900490600052602060002090810190610cc0919061156c565b6000602082840312156115ea57600080fd5b5035919050565b6000815180845260005b81811015611617576020818501810151868301820152016115fb565b506000602082860101526020601f19601f83011685010191505092915050565b634e487b7160e01b600052602160045260246000fd5b61ffff871681526001600160a01b038616602082015260c06040820181905260009061167b908301876115f1565b8560608401526003851061169f57634e487b7160e01b600052602160045260246000fd5b84608084015282810360a08401526116b781856115f1565b9998505050505050505050565b6000602082840312156116d657600080fd5b81356001600160e01b0319811681146116ee57600080fd5b9392505050565b80356001600160a01b038116811461170c57600080fd5b919050565b6000806040838503121561172457600080fd5b82359150611734602084016116f5565b90509250929050565b6000806040838503121561175057600080fd5b50508035926020909101359150565b60006020828403121561177157600080fd5b6116ee826116f5565b6020808252825182820181905260009190848201906040850190845b818110156117b257835183529284019291840191600101611796565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156117fd576117fd6117be565b604052919050565b600082601f83011261181657600080fd5b813567ffffffffffffffff811115611830576118306117be565b611843601f8201601f19166020016117d4565b81815284602083860101111561185857600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff82111561188f5761188f6117be565b5060051b60200190565b600080604083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b6118d086838701611805565b93506020915081850135818111156118e757600080fd5b8501601f810187136118f857600080fd5b803561190b61190682611875565b6117d4565b81815260059190911b8201840190848101908983111561192a57600080fd5b8584015b83811015611962578035868111156119465760008081fd5b6119548c8983890101611805565b84525091860191860161192e565b508096505050505050509250929050565b6000806020838503121561198657600080fd5b823567ffffffffffffffff8082111561199e57600080fd5b818501915085601f8301126119b257600080fd5b8135818111156119c157600080fd5b8660208260051b85010111156119d657600080fd5b60209290920196919550909350505050565b600080604083850312156119fb57600080fd5b611a04836116f5565b946020939093013593505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611a6757603f19888603018452611a558583516115f1565b94509285019290850190600101611a39565b5092979650505050505050565b8015158114610cc057600080fd5b600060208284031215611a9457600080fd5b81356116ee81611a74565b600082601f830112611ab057600080fd5b81356020611ac061190683611875565b82815260059290921b84018101918181019086841115611adf57600080fd5b8286015b84811015611afa5780358352918301918301611ae3565b509695505050505050565b600080600080600060a08688031215611b1d57600080fd5b611b26866116f5565b9450611b34602087016116f5565b9350604086013567ffffffffffffffff80821115611b5157600080fd5b611b5d89838a01611a9f565b94506060880135915080821115611b7357600080fd5b611b7f89838a01611a9f565b93506080880135915080821115611b9557600080fd5b50611ba288828901611805565b9150509295509295909350565b600080600080600060a08688031215611bc757600080fd5b611bd0866116f5565b9450611bde602087016116f5565b93506040860135925060608601359150608086013567ffffffffffffffff811115611c0857600080fd5b611ba288828901611805565b600181811c90821680611c2857607f821691505b602082108103611c4857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526023908201527f43313244414f3a2050726f706f73616c20416c7265616479204576616c75617460408201526265642160e81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561059b5761059b611ca7565b6020808252601d908201527f43313244414f3a204e6f7420686f6c64696e672046313220546f6b656e000000604082015260600190565b600060208284031215611d1957600080fd5b5051919050565b600060208284031215611d3257600080fd5b81516116ee81611a74565b600061ffff808316818103611d5457611d54611ca7565b6001019392505050565b601f82111561084657600081815260208120601f850160051c81016020861015611d855750805b601f850160051c820191505b81811015611da457828155600101611d91565b505050505050565b815167ffffffffffffffff811115611dc657611dc66117be565b611dda81611dd48454611c14565b84611d5e565b602080601f831160018114611e0f5760008415611df75750858301515b600019600386901b1c1916600185901b178555611da4565b600085815260208120601f198616915b82811015611e3e57888601518255948401946001909101908401611e1f565b5085821015611e5c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201611e7e57611e7e611ca7565b5060010190565b818103611e90575050565b611e9a8254611c14565b67ffffffffffffffff811115611eb257611eb26117be565b611ec081611dd48454611c14565b6000601f821160018114611ef45760008315611edc5750848201545b600019600385901b1c1916600184901b178455611f59565b600085815260209020601f19841690600086815260209020845b83811015611f2e5782860154825560019586019590910190602001611f0e565b5085831015611f4c5781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b808202811582820484141761059b5761059b611ca756fea26469706673582212203f2cbef92c22d4776f194363a7166982ef55e92c123110ad139104e20220f81b64736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063cf83ea7511610097578063e6b2603b11610071578063e6b2603b146103f1578063f23a6e61146103f9578063f3c1338714610418578063fbe56e641461042b57600080fd5b8063cf83ea75146103b8578063d5da24b9146103cb578063e0a8f6f5146103de57600080fd5b80638da5cb5b146102ee578063a1bd71b914610319578063b2fd60e114610339578063bc0904fb1461034c578063bc197c811461035f578063c276cd131461039757600080fd5b806347c661401161014b5780636ca91202116101255780636ca91202146102ad57806376bfd86d146102c05780638129fc1c146102d3578063870cb44f146102db57600080fd5b806347c661401461027157806349a4e50d1461029157806365894f621461029957600080fd5b8063013cf08b1461019357806301ffc9a7146101c15780630ad1a1ca146101e45780632c0a3f89146102215780632dfca445146102365780634460d3cf1461025e575b600080fd5b6101a66101a13660046115d8565b610433565b6040516101b89695949392919061164d565b60405180910390f35b6101d46101cf3660046116c4565b610590565b60405190151581526020016101b8565b6101d46101f2366004611711565b6000828152609a602090815260408083206001600160a01b038516845260070190915290205460ff1692915050565b61023461022f36600461173d565b6105a1565b005b60985461024b90600160a81b900461ffff1681565b60405161ffff90911681526020016101b8565b61023461026c36600461175f565b610740565b61028461027f3660046115d8565b61084b565b6040516101b8919061177a565b6102846108b0565b6098546101d490600160a01b900460ff1681565b6102346102bb366004611899565b610908565b6102346102ce366004611973565b610b1d565b610234610b50565b6102346102e93660046119e8565b610cc3565b609854610301906001600160a01b031681565b6040516001600160a01b0390911681526020016101b8565b61032c6103273660046115d8565b610ddd565b6040516101b89190611a12565b610234610347366004611a82565b610ecc565b609754610301906001600160a01b031681565b61037e61036d366004611b05565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101b8565b6103aa6103a53660046115d8565b610f11565b6040519081526020016101b8565b6102346103c63660046115d8565b610f32565b6103aa6103d936600461175f565b61109f565b6102346103ec3660046115d8565b61117a565b6102346111f7565b61037e610407366004611baf565b63f23a6e6160e01b95945050505050565b61023461042636600461175f565b6112ac565b6099546103aa565b609a602052600090815260409020805460018201805461ffff831693620100009093046001600160a01b031692919061046b90611c14565b80601f016020809104026020016040519081016040528092919081815260200182805461049790611c14565b80156104e45780601f106104b9576101008083540402835291602001916104e4565b820191906000526020600020905b8154815290600101906020018083116104c757829003601f168201915b50505050600283015460058401546006850180549495929460ff90921693509061050d90611c14565b80601f016020809104026020016040519081016040528092919081815260200182805461053990611c14565b80156105865780601f1061055b57610100808354040283529160200191610586565b820191906000526020600020905b81548152906001019060200180831161056957829003601f168201915b5050505050905086565b600061059b82611328565b92915050565b609854600160a01b900460ff16156105f95760405162461bcd60e51b815260206004820152601660248201527543313244414f3a20566f74696e67205061757365642160501b60448201526064015b60405180910390fd5b6000828152609a6020526040812090600582015460ff16600281111561062157610621611637565b1461063e5760405162461bcd60e51b81526004016105f090611c4e565b33600090815260078201602052604090205460ff16156106985760405162461bcd60e51b815260206004820152601560248201527410cc4c911053ce88105b1c9958591e48159bdd1959605a1b60448201526064016105f0565b3360008181526007830160205260408120805460ff19166001179055906106be9061109f565b9050808260030184815481106106d6576106d6611c91565b9060005260206000200160008282546106ef9190611cbd565b9091555050604080518581523360208201529081018290524260608201527f5bc338776aba01d0ac689e3f642138ebe3c5f3355c0723c81c07ffab8061591c9060800160405180910390a150505050565b61074b33600061135d565b6107675760405162461bcd60e51b81526004016105f090611cd0565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190611d07565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190611d20565b505050565b6000818152609a60209081526040918290206003018054835181840281018401909452808452606093928301828280156108a457602002820191906000526020600020905b815481526020019060010190808311610890575b50505050509050919050565b606060998054806020026020016040519081016040528092919081815260200182805480156108fe57602002820191906000526020600020905b8154815260200190600101908083116108ea575b5050505050905090565b61091333600061135d565b61092f5760405162461bcd60e51b81526004016105f090611cd0565b6000815167ffffffffffffffff81111561094b5761094b6117be565b604051908082528060200260200182016040528015610974578160200160208202803683370190505b5060988054919250600160a81b90910461ffff1690601561099483611d3d565b82546101009290920a61ffff81810219909316918316021790915560988054600160a81b9081900483166000818152609a6020526040808220805461ffff1916909317909255835483900485168152818120805462010000600160b01b0319163362010000021790559254919091049092168152206001019050610a188482611dac565b506098805461ffff600160a81b9182900481166000908152609a60209081526040808320426002909101559454939093049091168152919091208251610a669260039092019184019061144b565b50609854600160a81b900461ffff166000908152609a602090815260409091208351610a9a92600490920191850190611496565b50609854600160a81b900461ffff166000908152609a60205260408120600501805460ff191660018302179055506098546040805161ffff600160a81b90930492909216825233602083015242908201527f3417b456fad6209c73445d5efd446d686e75e4560f0f50c13b5a5cde976447b49060600160405180910390a1505050565b610b2833600061135d565b610b445760405162461bcd60e51b81526004016105f090611cd0565b610846609983836114e8565b600054610100900460ff1615808015610b705750600054600160ff909116105b80610b8a5750303b158015610b8a575060005460ff166001145b610bed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105f0565b6000805460ff191660011790558015610c10576000805461ff0019166101001790555b610c186113de565b609880546001600160a01b03199081163317909155609780549091167382beec866ae3a1a5fc1f8bb7a3dccd17e223c9491790556040805160608101825261012c815260646020820152600191810191909152610c7990609990600361152b565b508015610cc0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610cce33600061135d565b610cea5760405162461bcd60e51b81526004016105f090611cd0565b604051627eeac760e11b8152306004820152602481018290526000906001600160a01b0384169062fdd58e90604401602060405180830381865afa158015610d36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5a9190611d07565b604051637921219560e11b8152306004820152336024820152604481018490526064810182905260a06084820152600060a48201529091506001600160a01b0384169063f242432a9060c401600060405180830381600087803b158015610dc057600080fd5b505af1158015610dd4573d6000803e3d6000fd5b50505050505050565b6060609a6000838152602001908152602001600020600401805480602002602001604051908101604052809291908181526020016000905b82821015610ec1578382906000526020600020018054610e3490611c14565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6090611c14565b8015610ead5780601f10610e8257610100808354040283529160200191610ead565b820191906000526020600020905b815481529060010190602001808311610e9057829003601f168201915b505050505081526020019060010190610e15565b505050509050919050565b610ed733600061135d565b610ef35760405162461bcd60e51b81526004016105f090611cd0565b60988054911515600160a01b0260ff60a01b19909216919091179055565b60998181548110610f2157600080fd5b600091825260209091200154905081565b610f3d33600061135d565b610f595760405162461bcd60e51b81526004016105f090611cd0565b6000818152609a6020526040812090600582015460ff166002811115610f8157610f81611637565b14610f9e5760405162461bcd60e51b81526004016105f090611c4e565b600081600301805480602002602001604051908101604052809291908181526020018280548015610fee57602002820191906000526020600020905b815481526020019060010190808311610fda575b5050505050905060008060005b600485015481101561105a578284828151811061101a5761101a611c91565b602002602001015111156110485783818151811061103a5761103a611c91565b602002602001015192508091505b8061105281611e6c565b915050610ffb565b5083600401818154811061107057611070611c91565b9060005260206000200184600601908161108a9190611e85565b50505050600501805460ff1916600117905550565b60975460009081906001600160a01b0316815b60995481101561117157604051627eeac760e11b81526001600160a01b0386811660048301526024820183905283169062fdd58e90604401602060405180830381865afa158015611107573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112b9190611d07565b6099828154811061113e5761113e611c91565b90600052602060002001546111539190611f60565b61115d9084611cbd565b92508061116981611e6c565b9150506110b2565b50909392505050565b61118533600061135d565b6111a15760405162461bcd60e51b81526004016105f090611cd0565b6000818152609a6020526040812090600582015460ff1660028111156111c9576111c9611637565b146111e65760405162461bcd60e51b81526004016105f090611c4e565b600501805460ff1916600217905550565b61120233600061135d565b61121e5760405162461bcd60e51b81526004016105f090611cd0565b604051600090339047908381818185875af1925050503d8060008114611260576040519150601f19603f3d011682016040523d82523d6000602084013e611265565b606091505b5050905080610cc05760405162461bcd60e51b81526020600482015260136024820152725472616e73616374696f6e204661696c65642160681b60448201526064016105f0565b6098546001600160a01b031633146113065760405162461bcd60e51b815260206004820152601e60248201527f4572726f723a2043616c6c6572204d757374206265204f776e61626c6521000060448201526064016105f0565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b03198216630271189760e51b148061059b57506301ffc9a760e01b6001600160e01b031983161461059b565b609754604051627eeac760e11b81526001600160a01b0384811660048301526024820184905260009216908290829062fdd58e90604401602060405180830381865afa1580156113b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d59190611d07565b11949350505050565b600054610100900460ff166114495760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016105f0565b565b828054828255906000526020600020908101928215611486579160200282015b8281111561148657825182559160200191906001019061146b565b5061149292915061156c565b5090565b8280548282559060005260206000209081019282156114dc579160200282015b828111156114dc57825182906114cc9082611dac565b50916020019190600101906114b6565b50611492929150611581565b828054828255906000526020600020908101928215611486579160200282015b828111156114865763ffffffff8335168255602090920191600190910190611508565b828054828255906000526020600020908101928215611486579160200282015b82811115611486578251829061ffff1690559160200191906001019061154b565b5b80821115611492576000815560010161156d565b80821115611492576000611595828261159e565b50600101611581565b5080546115aa90611c14565b6000825580601f106115ba575050565b601f016020900490600052602060002090810190610cc0919061156c565b6000602082840312156115ea57600080fd5b5035919050565b6000815180845260005b81811015611617576020818501810151868301820152016115fb565b506000602082860101526020601f19601f83011685010191505092915050565b634e487b7160e01b600052602160045260246000fd5b61ffff871681526001600160a01b038616602082015260c06040820181905260009061167b908301876115f1565b8560608401526003851061169f57634e487b7160e01b600052602160045260246000fd5b84608084015282810360a08401526116b781856115f1565b9998505050505050505050565b6000602082840312156116d657600080fd5b81356001600160e01b0319811681146116ee57600080fd5b9392505050565b80356001600160a01b038116811461170c57600080fd5b919050565b6000806040838503121561172457600080fd5b82359150611734602084016116f5565b90509250929050565b6000806040838503121561175057600080fd5b50508035926020909101359150565b60006020828403121561177157600080fd5b6116ee826116f5565b6020808252825182820181905260009190848201906040850190845b818110156117b257835183529284019291840191600101611796565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156117fd576117fd6117be565b604052919050565b600082601f83011261181657600080fd5b813567ffffffffffffffff811115611830576118306117be565b611843601f8201601f19166020016117d4565b81815284602083860101111561185857600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff82111561188f5761188f6117be565b5060051b60200190565b600080604083850312156118ac57600080fd5b823567ffffffffffffffff808211156118c457600080fd5b6118d086838701611805565b93506020915081850135818111156118e757600080fd5b8501601f810187136118f857600080fd5b803561190b61190682611875565b6117d4565b81815260059190911b8201840190848101908983111561192a57600080fd5b8584015b83811015611962578035868111156119465760008081fd5b6119548c8983890101611805565b84525091860191860161192e565b508096505050505050509250929050565b6000806020838503121561198657600080fd5b823567ffffffffffffffff8082111561199e57600080fd5b818501915085601f8301126119b257600080fd5b8135818111156119c157600080fd5b8660208260051b85010111156119d657600080fd5b60209290920196919550909350505050565b600080604083850312156119fb57600080fd5b611a04836116f5565b946020939093013593505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611a6757603f19888603018452611a558583516115f1565b94509285019290850190600101611a39565b5092979650505050505050565b8015158114610cc057600080fd5b600060208284031215611a9457600080fd5b81356116ee81611a74565b600082601f830112611ab057600080fd5b81356020611ac061190683611875565b82815260059290921b84018101918181019086841115611adf57600080fd5b8286015b84811015611afa5780358352918301918301611ae3565b509695505050505050565b600080600080600060a08688031215611b1d57600080fd5b611b26866116f5565b9450611b34602087016116f5565b9350604086013567ffffffffffffffff80821115611b5157600080fd5b611b5d89838a01611a9f565b94506060880135915080821115611b7357600080fd5b611b7f89838a01611a9f565b93506080880135915080821115611b9557600080fd5b50611ba288828901611805565b9150509295509295909350565b600080600080600060a08688031215611bc757600080fd5b611bd0866116f5565b9450611bde602087016116f5565b93506040860135925060608601359150608086013567ffffffffffffffff811115611c0857600080fd5b611ba288828901611805565b600181811c90821680611c2857607f821691505b602082108103611c4857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526023908201527f43313244414f3a2050726f706f73616c20416c7265616479204576616c75617460408201526265642160e81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561059b5761059b611ca7565b6020808252601d908201527f43313244414f3a204e6f7420686f6c64696e672046313220546f6b656e000000604082015260600190565b600060208284031215611d1957600080fd5b5051919050565b600060208284031215611d3257600080fd5b81516116ee81611a74565b600061ffff808316818103611d5457611d54611ca7565b6001019392505050565b601f82111561084657600081815260208120601f850160051c81016020861015611d855750805b601f850160051c820191505b81811015611da457828155600101611d91565b505050505050565b815167ffffffffffffffff811115611dc657611dc66117be565b611dda81611dd48454611c14565b84611d5e565b602080601f831160018114611e0f5760008415611df75750858301515b600019600386901b1c1916600185901b178555611da4565b600085815260208120601f198616915b82811015611e3e57888601518255948401946001909101908401611e1f565b5085821015611e5c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201611e7e57611e7e611ca7565b5060010190565b818103611e90575050565b611e9a8254611c14565b67ffffffffffffffff811115611eb257611eb26117be565b611ec081611dd48454611c14565b6000601f821160018114611ef45760008315611edc5750848201545b600019600385901b1c1916600184901b178455611f59565b600085815260209020601f19841690600086815260209020845b83811015611f2e5782860154825560019586019590910190602001611f0e565b5085831015611f4c5781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b808202811582820484141761059b5761059b611ca756fea26469706673582212203f2cbef92c22d4776f194363a7166982ef55e92c123110ad139104e20220f81b64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.