Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17164740 | 548 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x2Af569F4...2355F6da0 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
BySpecificAddress
Compiler Version
v0.8.6+commit.11564f7e
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.7.0; import "../../base/model/IProposalsManager.sol"; import "../../core/model/IOrganization.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@ethereansos/items-v2/contracts/model/Item.sol"; import {TransferUtilities} from "@ethereansos/swissknife/contracts/lib/GeneralUtilities.sol"; contract BySpecificAddress is IProposalChecker { string public constant LABEL = 'host'; string public uri; address public value; bool public discriminant; function lazyInit(bytes memory lazyInitData) external returns(bytes memory lazyInitResponseData) { require(keccak256(bytes(uri)) == keccak256("")); (uri, lazyInitResponseData) = abi.decode(lazyInitData, (string, bytes)); require(keccak256(bytes(uri)) != keccak256("")); (value, discriminant) = abi.decode(lazyInitResponseData, (address, bool)); lazyInitResponseData = ""; } function setValue(address newValue) external { require(msg.sender == value, "unauthorized"); require(discriminant, "cannot change"); require(newValue != address(0), "void"); value = newValue; } function makeReadOnly() external { require(msg.sender == value, "unauthorized"); require(discriminant, "cannot change"); discriminant = false; } function check(address, bytes32, bytes calldata, address from, address) external override view returns(bool) { return from == value; } } contract ChangeOrganizationUriProposal { string public constant LABEL = 'changeOrganizationUri'; string public uri; string public value; string public additionalUri; function lazyInit(bytes memory lazyInitData) external returns(bytes memory lazyInitResponseData) { require(keccak256(bytes(uri)) == keccak256("")); (uri, lazyInitResponseData) = abi.decode(lazyInitData, (string, bytes)); require(keccak256(bytes(uri)) != keccak256("")); (additionalUri, value) = abi.decode(lazyInitResponseData, (string, string)); lazyInitResponseData = ""; } function execute(bytes32) external { IOrganization(ILazyInitCapableElement(msg.sender).host()).setUri(value); } } /*contract SlashingConditionAtCreation { using TransferUtilities for address; uint256 public constant ONE_HUNDRED = 1e18; string public uri; uint256 public tokenIndex; bool public amountIsPercentage; uint256 public value; mapping(bytes32 => bool) public alreadyCalled; mapping(bytes32 => uint256) public toValue; function lazyInit(bytes memory lazyInitData) external returns(bytes memory lazyInitResponseData) { require(keccak256(bytes(uri)) == keccak256("")); (uri, lazyInitResponseData) = abi.decode(lazyInitData, (string, bytes)); require(keccak256(bytes(uri)) != keccak256("")); (tokenIndex, amountIsPercentage, value) = abi.decode(lazyInitResponseData, (uint256, bool, uint256)); lazyInitResponseData = ""; } function check(address, bytes32 proposalId, bytes calldata proposalData, address, address) external returns(bool) { IProposalsManager.Proposal memory proposal = abi.decode(proposalData, (IProposalsManager.Proposal)); if(!alreadyCalled[proposalId]) { _take(proposalId, proposal); } else { _give(proposalId, proposal); } return true; } function _take(bytes32 proposalId, IProposalsManager.Proposal memory proposal) private { require(IProposalsManager(address(this)).lastProposalId() == proposalId, "not last proposal"); alreadyCalled[proposalId] = true; address from = proposal.proposer; (address[] memory collections, uint256[] memory objecIds,) = abi.decode(proposal.votingTokens, (address[], uint256[], uint256[])); address collection = collections[tokenIndex]; uint256 objectId = objecIds[tokenIndex]; if(collection == address(0)) { toValue[proposalId] = _takeERC20(address(uint160(objectId)), from); } else { toValue[proposalId] = _takeItem(collection, objectId, from); } } function _give(bytes32 proposalId, IProposalsManager.Proposal memory proposal) private { require(toValue[proposalId] > 0, "empty value"); address to = proposal.proposer; (address[] memory collections, uint256[] memory objecIds,) = abi.decode(proposal.votingTokens, (address[], uint256[], uint256[])); address collection = collections[tokenIndex]; uint256 objectId = objecIds[tokenIndex]; if(collection == address(0)) { address tokenAddress = address(uint160(objectId)); tokenAddress.safeTransfer(to, toValue[proposalId]); } else { Item(collection).safeTransferFrom(address(this), to, objectId, toValue[proposalId], ""); } toValue[proposalId] = 0; } function _takeERC20(address tokenAddress, address from) private returns (uint256 realValue) { realValue = amountIsPercentage ? _calculatePercentage(IERC20(tokenAddress).totalSupply(), value) : value; tokenAddress.safeTransferFrom(from, address(this), realValue); } function _takeItem(address tokenAddress, uint256 objectId, address from) private returns (uint256 realValue) { Item item = Item(tokenAddress); realValue = amountIsPercentage ? _calculatePercentage(item.totalSupply(objectId), value) : value; item.safeTransferFrom(from, address(this), objectId, realValue, ""); } function _calculatePercentage(uint256 totalSupply, uint256 percentage) private pure returns (uint256) { return (totalSupply * ((percentage * 1e18) / ONE_HUNDRED)) / 1e18; } } contract VoteAtCreation { using TransferUtilities for address; uint256 public constant ONE_HUNDRED = 1e18; string public uri; uint256 public tokenIndex; bool public amountIsPercentage; uint256 public value; event Init(uint256 tokenIndex, bool amountIsPercentage, uint256 value); function lazyInit(bytes memory lazyInitData) external returns(bytes memory lazyInitResponseData) { require(keccak256(bytes(uri)) == keccak256("")); (uri, lazyInitResponseData) = abi.decode(lazyInitData, (string, bytes)); require(keccak256(bytes(uri)) != keccak256("")); (tokenIndex, amountIsPercentage, value) = abi.decode(lazyInitResponseData, (uint256, bool, uint256)); emit Init(tokenIndex, amountIsPercentage, value); lazyInitResponseData = ""; } event Malmenato(address[] add, uint256[] obj, uint256 addLength, uint256 objLength, uint256 tokenIndex); function check(address, bytes32 proposalId, bytes calldata proposalData, address, address) external returns(bool) { require(IProposalsManager(address(this)).lastProposalId() == proposalId, "not last proposal"); IProposalsManager.Proposal memory proposal = abi.decode(proposalData, (IProposalsManager.Proposal)); address from = proposal.proposer; (address[] memory collections, uint256[] memory objectIds,) = abi.decode(proposal.votingTokens, (address[], uint256[], uint256[])); emit Malmenato(collections, objectIds, collections.length, objectIds.length, tokenIndex); address collection = collections[tokenIndex]; uint256 objectId = objectIds[tokenIndex]; if(collection == address(0)) { _voteWithERC20(address(uint160(objectId)), from, proposalId); } else { _voteWithItem(collection, objectId, from, proposalId); } return true; } function _voteWithERC20(address tokenAddress, address from, bytes32 proposalId) private returns (uint256 realValue) { realValue = amountIsPercentage ? _calculatePercentage(IERC20(tokenAddress).totalSupply(), value) : value; tokenAddress.safeTransferFrom(from, address(this), realValue); tokenAddress.safeApprove(address(this), realValue); IProposalsManager(address(this)).vote(tokenAddress, "", proposalId, realValue, 0, from, false); } function _voteWithItem(address tokenAddress, uint256 objectId, address from, bytes32 proposalId) private returns (uint256 realValue) { Item item = Item(tokenAddress); realValue = amountIsPercentage ? _calculatePercentage(item.totalSupply(objectId), value) : value; item.safeTransferFrom(from, address(this), objectId, realValue, abi.encode(proposalId, realValue, 0, from, false)); } function _calculatePercentage(uint256 totalSupply, uint256 percentage) private pure returns (uint256) { return (totalSupply * ((percentage * 1e18) / ONE_HUNDRED)) / 1e18; } }*/
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; library BehaviorUtilities { function randomKey(uint256 i) internal view returns (bytes32) { return keccak256(abi.encode(i, block.timestamp, block.number, tx.origin, tx.gasprice, block.coinbase, block.difficulty, msg.sender, blockhash(block.number - 5))); } function calculateProjectedArraySizeAndLoopUpperBound(uint256 arraySize, uint256 start, uint256 offset) internal pure returns(uint256 projectedArraySize, uint256 projectedArrayLoopUpperBound) { if(arraySize != 0 && start < arraySize && offset != 0) { uint256 length = start + offset; if(start < (length = length > arraySize ? arraySize : length)) { projectedArraySize = (projectedArrayLoopUpperBound = length) - start; } } } } library ReflectionUtilities { function read(address subject, bytes memory inputData) internal view returns(bytes memory returnData) { bool result; (result, returnData) = subject.staticcall(inputData); if(!result) { assembly { revert(add(returnData, 0x20), mload(returnData)) } } } function submit(address subject, uint256 value, bytes memory inputData) internal returns(bytes memory returnData) { bool result; (result, returnData) = subject.call{value : value}(inputData); if(!result) { assembly { revert(add(returnData, 0x20), mload(returnData)) } } } function isContract(address subject) internal view returns (bool) { if(subject == address(0)) { return false; } uint256 codeLength; assembly { codeLength := extcodesize(subject) } return codeLength > 0; } function clone(address originalContract) internal returns(address copyContract) { assembly { mstore( 0, or( 0x5880730000000000000000000000000000000000000000803b80938091923cF3, mul(originalContract, 0x1000000000000000000) ) ) copyContract := create(0, 0, 32) switch extcodesize(copyContract) case 0 { invalid() } } } } library BytesUtilities { bytes private constant ALPHABET = "0123456789abcdef"; string internal constant BASE64_ENCODER_DATA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; function asAddress(bytes memory b) internal pure returns(address) { if(b.length == 0) { return address(0); } if(b.length == 20) { address addr; assembly { addr := mload(add(b, 20)) } return addr; } return abi.decode(b, (address)); } function asAddressArray(bytes memory b) internal pure returns(address[] memory callResult) { if(b.length > 0) { return abi.decode(b, (address[])); } } function asBool(bytes memory bs) internal pure returns(bool) { return asUint256(bs) != 0; } function asBoolArray(bytes memory b) internal pure returns(bool[] memory callResult) { if(b.length > 0) { return abi.decode(b, (bool[])); } } function asBytesArray(bytes memory b) internal pure returns(bytes[] memory callResult) { if(b.length > 0) { return abi.decode(b, (bytes[])); } } function asString(bytes memory b) internal pure returns(string memory callResult) { if(b.length > 0) { return abi.decode(b, (string)); } } function asStringArray(bytes memory b) internal pure returns(string[] memory callResult) { if(b.length > 0) { return abi.decode(b, (string[])); } } function asUint256(bytes memory bs) internal pure returns(uint256 x) { if (bs.length >= 32) { assembly { x := mload(add(bs, add(0x20, 0))) } } } function asUint256Array(bytes memory b) internal pure returns(uint256[] memory callResult) { if(b.length > 0) { return abi.decode(b, (uint256[])); } } function toString(bytes memory data) internal pure returns(string memory) { bytes memory str = new bytes(2 + data.length * 2); str[0] = "0"; str[1] = "x"; for (uint256 i = 0; i < data.length; i++) { str[2+i*2] = ALPHABET[uint256(uint8(data[i] >> 4))]; str[3+i*2] = ALPHABET[uint256(uint8(data[i] & 0x0f))]; } return string(str); } function asSingletonArray(bytes memory a) internal pure returns(bytes[] memory array) { array = new bytes[](1); array[0] = a; } function toBase64(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ''; string memory table = BASE64_ENCODER_DATA; uint256 encodedLen = 4 * ((data.length + 2) / 3); string memory result = new string(encodedLen + 32); assembly { mstore(result, encodedLen) let tablePtr := add(table, 1) let dataPtr := data let endPtr := add(dataPtr, mload(data)) let resultPtr := add(result, 32) for {} lt(dataPtr, endPtr) {} { dataPtr := add(dataPtr, 3) let input := mload(dataPtr) mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and( input, 0x3F)))) resultPtr := add(resultPtr, 1) } switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } } library StringUtilities { bytes1 private constant CHAR_0 = bytes1('0'); bytes1 private constant CHAR_A = bytes1('A'); bytes1 private constant CHAR_a = bytes1('a'); bytes1 private constant CHAR_f = bytes1('f'); bytes internal constant BASE64_DECODER_DATA = hex"0000000000000000000000000000000000000000000000000000000000000000" hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000" hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000" hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000"; function isEmpty(string memory test) internal pure returns (bool) { return equals(test, ""); } function equals(string memory a, string memory b) internal pure returns(bool) { return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)); } function toLowerCase(string memory str) internal pure returns(string memory) { bytes memory bStr = bytes(str); for (uint256 i = 0; i < bStr.length; i++) { bStr[i] = bStr[i] >= 0x41 && bStr[i] <= 0x5A ? bytes1(uint8(bStr[i]) + 0x20) : bStr[i]; } return string(bStr); } function asBytes(string memory str) internal pure returns(bytes memory toDecode) { bytes memory data = abi.encodePacked(str); if(data.length == 0 || data[0] != "0" || (data[1] != "x" && data[1] != "X")) { return ""; } uint256 start = 2; toDecode = new bytes((data.length - 2) / 2); for(uint256 i = 0; i < toDecode.length; i++) { toDecode[i] = bytes1(_fromHexChar(uint8(data[start++])) + _fromHexChar(uint8(data[start++])) * 16); } } function toBase64(string memory input) internal pure returns(string memory) { return BytesUtilities.toBase64(abi.encodePacked(input)); } function fromBase64(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); bytes memory table = BASE64_DECODER_DATA; uint256 decodedLen = (data.length / 4) * 3; bytes memory result = new bytes(decodedLen + 32); assembly { let lastBytes := mload(add(data, mload(data))) if eq(and(lastBytes, 0xFF), 0x3d) { decodedLen := sub(decodedLen, 1) if eq(and(lastBytes, 0xFFFF), 0x3d3d) { decodedLen := sub(decodedLen, 1) } } mstore(result, decodedLen) let tablePtr := add(table, 1) let dataPtr := data let endPtr := add(dataPtr, mload(data)) let resultPtr := add(result, 32) for {} lt(dataPtr, endPtr) {} { dataPtr := add(dataPtr, 4) let input := mload(dataPtr) let output := add( add( shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)), shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))), add( shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)), and(mload(add(tablePtr, and( input , 0xFF))), 0xFF) ) ) mstore(resultPtr, shl(232, output)) resultPtr := add(resultPtr, 3) } } return result; } function _fromHexChar(uint8 c) private pure returns (uint8) { bytes1 charc = bytes1(c); return charc < CHAR_0 || charc > CHAR_f ? 0 : (charc < CHAR_A ? 0 : 10) + c - uint8(charc < CHAR_A ? CHAR_0 : charc < CHAR_a ? CHAR_A : CHAR_a); } } library Uint256Utilities { function asSingletonArray(uint256 n) internal pure returns(uint256[] memory array) { array = new uint256[](1); array[0] = n; } function toHex(uint256 _i) internal pure returns (string memory) { return BytesUtilities.toString(abi.encodePacked(_i)); } function toString(uint256 _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint256 j = _i; uint256 len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint256 k = len; while (_i != 0) { k = k-1; uint8 temp = (48 + uint8(_i - _i / 10 * 10)); bytes1 b1 = bytes1(temp); bstr[k] = b1; _i /= 10; } return string(bstr); } function sum(uint256[] memory arr) internal pure returns (uint256 result) { for(uint256 i = 0; i < arr.length; i++) { result += arr[i]; } } } library AddressUtilities { function asSingletonArray(address a) internal pure returns(address[] memory array) { array = new address[](1); array[0] = a; } function toString(address _addr) internal pure returns (string memory) { return _addr == address(0) ? "0x0000000000000000000000000000000000000000" : BytesUtilities.toString(abi.encodePacked(_addr)); } } library Bytes32Utilities { function asSingletonArray(bytes32 a) internal pure returns(bytes32[] memory array) { array = new bytes32[](1); array[0] = a; } function toString(bytes32 bt) internal pure returns (string memory) { return bt == bytes32(0) ? "0x0000000000000000000000000000000000000000000000000000000000000000" : BytesUtilities.toString(abi.encodePacked(bt)); } } library TransferUtilities { using ReflectionUtilities for address; function balanceOf(address erc20TokenAddress, address account) internal view returns(uint256) { if(erc20TokenAddress == address(0)) { return account.balance; } return abi.decode(erc20TokenAddress.read(abi.encodeWithSelector(IERC20(erc20TokenAddress).balanceOf.selector, account)), (uint256)); } function allowance(address erc20TokenAddress, address account, address spender) internal view returns(uint256) { if(erc20TokenAddress == address(0)) { return 0; } return abi.decode(erc20TokenAddress.read(abi.encodeWithSelector(IERC20(erc20TokenAddress).allowance.selector, account, spender)), (uint256)); } function safeApprove(address erc20TokenAddress, address spender, uint256 value) internal { bytes memory returnData = erc20TokenAddress.submit(0, abi.encodeWithSelector(IERC20(erc20TokenAddress).approve.selector, spender, value)); require(returnData.length == 0 || abi.decode(returnData, (bool)), 'APPROVE_FAILED'); } function safeTransfer(address erc20TokenAddress, address to, uint256 value) internal { if(value == 0) { return; } if(erc20TokenAddress == address(0)) { to.submit(value, ""); return; } bytes memory returnData = erc20TokenAddress.submit(0, abi.encodeWithSelector(IERC20(erc20TokenAddress).transfer.selector, to, value)); require(returnData.length == 0 || abi.decode(returnData, (bool)), 'TRANSFER_FAILED'); } function safeTransferFrom(address erc20TokenAddress, address from, address to, uint256 value) internal { if(value == 0) { return; } if(erc20TokenAddress == address(0)) { to.submit(value, ""); return; } bytes memory returnData = erc20TokenAddress.submit(0, abi.encodeWithSelector(IERC20(erc20TokenAddress).transferFrom.selector, from, to, value)); require(returnData.length == 0 || abi.decode(returnData, (bool)), 'TRANSFERFROM_FAILED'); } }
//SPDX-License-Identifier: MIT pragma solidity >=0.7.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "./IERC1155Views.sol"; struct Header { address host; string name; string symbol; string uri; } struct CreateItem { Header header; bytes32 collectionId; uint256 id; address[] accounts; uint256[] amounts; } interface Item is IERC1155, IERC1155Views { event CollectionItem(bytes32 indexed fromCollectionId, bytes32 indexed toCollectionId, uint256 indexed itemId); function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint256); function burn(address account, uint256 itemId, uint256 amount) external; function burnBatch(address account, uint256[] calldata itemIds, uint256[] calldata amounts) external; function burn(address account, uint256 itemId, uint256 amount, bytes calldata data) external; function burnBatch(address account, uint256[] calldata itemIds, uint256[] calldata amounts, bytes calldata data) external; function mintItems(CreateItem[] calldata items) external returns(uint256[] memory itemIds); function setItemsCollection(uint256[] calldata itemIds, bytes32[] calldata collectionIds) external returns(bytes32[] memory oldCollectionIds); function setItemsMetadata(uint256[] calldata itemIds, Header[] calldata newValues) external returns(Header[] memory oldValues); function interoperableOf(uint256 itemId) external view returns(address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "@ethereansos/swissknife/contracts/dynamicMetadata/model/IDynamicMetadataCapableElement.sol"; interface IOrganization is IDynamicMetadataCapableElement { struct Component { bytes32 key; address location; bool active; bool log; } function keyOf(address componentAddress) external view returns(bytes32); function history(bytes32 key) external view returns(address[] memory componentsAddresses); function batchHistory(bytes32[] calldata keys) external view returns(address[][] memory componentsAddresses); function get(bytes32 key) external view returns(address componentAddress); function list(bytes32[] calldata keys) external view returns(address[] memory componentsAddresses); function isActive(address subject) external view returns(bool); function keyIsActive(bytes32 key) external view returns(bool); function set(Component calldata) external returns(address replacedComponentAddress); function batchSet(Component[] calldata) external returns (address[] memory replacedComponentAddresses); event ComponentSet(bytes32 indexed key, address indexed from, address indexed to, bool active); function submit(address location, bytes calldata payload, address restReceiver) external payable returns(bytes memory response); }
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "@ethereansos/swissknife/contracts/generic/model/ILazyInitCapableElement.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; interface IProposalsManager is IERC1155Receiver, ILazyInitCapableElement { struct ProposalCode { address location; bytes bytecode; } struct ProposalCodes { ProposalCode[] codes; bool alsoTerminate; } struct Proposal { address proposer; address[] codeSequence; uint256 creationBlock; uint256 accept; uint256 refuse; address triggeringRules; address[] canTerminateAddresses; address[] validatorsAddresses; bool validationPassed; uint256 terminationBlock; bytes votingTokens; } struct ProposalConfiguration { address[] collections; uint256[] objectIds; uint256[] weights; address creationRules; address triggeringRules; address[] canTerminateAddresses; address[] validatorsAddresses; } function batchCreate(ProposalCodes[] calldata codeSequences) external returns(bytes32[] memory createdProposalIds); function list(bytes32[] calldata proposalIds) external view returns(Proposal[] memory); function votes(bytes32[] calldata proposalIds, address[] calldata voters, bytes32[][] calldata items) external view returns(uint256[][] memory accepts, uint256[][] memory refuses, uint256[][] memory toWithdraw); function weight(bytes32 code) external view returns(uint256); function vote(address erc20TokenAddress, bytes memory permitSignature, bytes32 proposalId, uint256 accept, uint256 refuse, address voter, bool alsoTerminate) external payable; function batchVote(bytes[] calldata data) external payable; function withdrawAll(bytes32[] memory proposalIds, address voterOrReceiver, bool afterTermination) external; function terminate(bytes32[] calldata proposalIds) external; function configuration() external view returns(ProposalConfiguration memory); function setConfiguration(ProposalConfiguration calldata newValue) external returns(ProposalConfiguration memory oldValue); function lastProposalId() external view returns(bytes32); function lastVoteBlock(address voter) external view returns (uint256); event ProposalCreated(address indexed proposer, address indexed code, bytes32 indexed proposalId); event ProposalWeight(bytes32 indexed proposalId, address indexed collection, uint256 indexed id, bytes32 key, uint256 weight); event ProposalTerminated(bytes32 indexed proposalId, bool result, bytes errorData); event Accept(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); event MoveToAccept(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); event RetireAccept(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); event Refuse(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); event MoveToRefuse(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); event RetireRefuse(bytes32 indexed proposalId, address indexed voter, bytes32 indexed item, uint256 amount); } interface IProposalChecker { function check(address proposalsManagerAddress, bytes32 id, bytes calldata data, address from, address voter) external view returns(bool); } interface IExternalProposalsManagerCommands { function createProposalCodeSequence(bytes32 proposalId, IProposalsManager.ProposalCode[] memory codeSequenceInput, address sender) external returns (address[] memory codeSequence, IProposalsManager.ProposalConfiguration memory localConfiguration); function proposalCanBeFinalized(bytes32 proposalId, IProposalsManager.Proposal memory proposal, bool validationPassed, bool result) external view returns (bool); function isVotable(bytes32 proposalId, IProposalsManager.Proposal memory proposal, address from, address voter, bool voteOrWithtraw) external view returns (bytes memory response); }
//SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "../../generic/model/ILazyInitCapableElement.sol"; interface IDynamicMetadataCapableElement is ILazyInitCapableElement { function uri() external view returns(string memory); function plainUri() external view returns(string memory); function setUri(string calldata newValue) external returns (string memory oldValue); function dynamicUriResolver() external view returns(address); function setDynamicUriResolver(address newValue) external returns(address oldValue); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @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. 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. 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 pragma solidity >=0.7.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; interface ILazyInitCapableElement is IERC165 { function lazyInit(bytes calldata lazyInitData) external returns(bytes memory initResponse); function initializer() external view returns(address); event Host(address indexed from, address indexed to); function host() external view returns(address); function setHost(address newValue) external returns(address oldValue); function subjectIsAuthorizedFor(address subject, address location, bytes4 selector, bytes calldata payload, uint256 value) external view returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; /** * @title IERC1155Views - An optional utility interface to improve the ERC-1155 Standard. * @dev This interface introduces some additional capabilities for ERC-1155 Tokens. */ interface IERC1155Views { /** * @dev Returns the total supply of the given token id * @param itemId the id of the token whose availability you want to know */ function totalSupply(uint256 itemId) external view returns (uint256); /** * @dev Returns the name of the given token id * @param itemId the id of the token whose name you want to know */ function name(uint256 itemId) external view returns (string memory); /** * @dev Returns the symbol of the given token id * @param itemId the id of the token whose symbol you want to know */ function symbol(uint256 itemId) external view returns (string memory); /** * @dev Returns the decimals of the given token id * @param itemId the id of the token whose decimals you want to know */ function decimals(uint256 itemId) external view returns (uint256); /** * @dev Returns the uri of the given token id * @param itemId the id of the token whose uri you want to know */ function uri(uint256 itemId) external view returns (string memory); }
// SPDX-License-Identifier: MIT 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 be 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 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" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"LABEL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discriminant","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"lazyInitData","type":"bytes"}],"name":"lazyInit","outputs":[{"internalType":"bytes","name":"lazyInitResponseData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"makeReadOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newValue","type":"address"}],"name":"setValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"value","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638fb242fa1161005b5780638fb242fa14610119578063eac989f814610151578063f6eca4bc14610159578063feaf83221461016d57600080fd5b80630f38d8c31461008d5780633fa4f245146100c6578063457f4bcc146100f15780636435c3e714610104575b600080fd5b6100b0604051806040016040528060048152602001631a1bdcdd60e21b81525081565b6040516100bd9190610876565b60405180910390f35b6001546100d9906001600160a01b031681565b6040516001600160a01b0390911681526020016100bd565b6100b06100ff3660046106a4565b610175565b610117610112366004610597565b61028b565b005b6101416101273660046105f3565b506001546001600160a01b03908116911614949350505050565b60405190151581526020016100bd565b6100b0610383565b60015461014190600160a01b900460ff1681565b610117610411565b60607fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060006040516101a791906107da565b6040518091039020146101b957600080fd5b818060200190518101906101cd919061071f565b815190925082906101e59060009060208501906104b2565b5050507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470600060405161021891906107da565b6040518091039020141561022b57600080fd5b8080602001905181019061023f91906105b4565b600180546001600160a01b039093166001600160a01b0319921515600160a01b02929092166001600160a81b031990931692909217179055505060408051602081019091526000815290565b6001546001600160a01b031633146102d95760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b60448201526064015b60405180910390fd5b600154600160a01b900460ff166103225760405162461bcd60e51b815260206004820152600d60248201526c63616e6e6f74206368616e676560981b60448201526064016102d0565b6001600160a01b0381166103615760405162461bcd60e51b81526004016102d0906020808252600490820152631d9bda5960e21b604082015260600190565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000805461039090610912565b80601f01602080910402602001604051908101604052809291908181526020018280546103bc90610912565b80156104095780601f106103de57610100808354040283529160200191610409565b820191906000526020600020905b8154815290600101906020018083116103ec57829003601f168201915b505050505081565b6001546001600160a01b0316331461045a5760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b60448201526064016102d0565b600154600160a01b900460ff166104a35760405162461bcd60e51b815260206004820152600d60248201526c63616e6e6f74206368616e676560981b60448201526064016102d0565b6001805460ff60a01b19169055565b8280546104be90610912565b90600052602060002090601f0160209004810192826104e05760008555610526565b82601f106104f957805160ff1916838001178555610526565b82800160010185558215610526579182015b8281111561052657825182559160200191906001019061050b565b50610532929150610536565b5090565b5b808211156105325760008155600101610537565b600061055e610559846108ba565b610889565b905082815283838301111561057257600080fd5b6105808360208301846108e2565b9392505050565b803561059281610963565b919050565b6000602082840312156105a957600080fd5b813561058081610963565b600080604083850312156105c757600080fd5b82516105d281610963565b602084015190925080151581146105e857600080fd5b809150509250929050565b60008060008060008060a0878903121561060c57600080fd5b863561061781610963565b955060208701359450604087013567ffffffffffffffff8082111561063b57600080fd5b818901915089601f83011261064f57600080fd5b81358181111561065e57600080fd5b8a602082850101111561067057600080fd5b602083019650809550505050606087013561068a81610963565b915061069860808801610587565b90509295509295509295565b6000602082840312156106b657600080fd5b813567ffffffffffffffff8111156106cd57600080fd5b8201601f810184136106de57600080fd5b80356106ec610559826108ba565b81815285602083850101111561070157600080fd5b81602084016020830137600091810160200191909152949350505050565b6000806040838503121561073257600080fd5b825167ffffffffffffffff8082111561074a57600080fd5b818501915085601f83011261075e57600080fd5b61076d8683516020850161054b565b9350602085015191508082111561078357600080fd5b508301601f8101851361079557600080fd5b6107a48582516020840161054b565b9150509250929050565b600081518084526107c68160208601602086016108e2565b601f01601f19169290920160200192915050565b600080835481600182811c9150808316806107f657607f831692505b602080841082141561081657634e487b7160e01b86526022600452602486fd5b81801561082a576001811461083b57610868565b60ff19861689528489019650610868565b60008a81526020902060005b868110156108605781548b820152908501908301610847565b505084890196505b509498975050505050505050565b60208152600061058060208301846107ae565b604051601f8201601f1916810167ffffffffffffffff811182821017156108b2576108b261094d565b604052919050565b600067ffffffffffffffff8211156108d4576108d461094d565b50601f01601f191660200190565b60005b838110156108fd5781810151838201526020016108e5565b8381111561090c576000848401525b50505050565b600181811c9082168061092657607f821691505b6020821081141561094757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461097857600080fd5b5056fea264697066735822122008d23540ecba6e6464a1cb3aa28f14bce14bb86e55b3a92c7fceaedd18965f6764736f6c63430008060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.