Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
PlutocatsSeeder
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 /// @title Plutocats Seeder /// Includes modifications for new traits /// Based on Nouns https://github.com/nounsDAO/nouns-monorepo/blob/master/packages/nouns-contracts/contracts/NounsSeeder.sol pragma solidity >=0.8.0; import {IPlutocatsSeeder} from "./interfaces/IPlutocatsSeeder.sol"; import {IPlutocatsDescriptorMinimal} from "./interfaces/IPlutocatsDescriptorMinimal.sol"; contract PlutocatsSeeder is IPlutocatsSeeder { /// Generate a pseudo-random seed for a given tokenId. function generateSeed(uint256 tokenId, IPlutocatsDescriptorMinimal descriptor) external view override returns (Seed memory) { uint256 pseudorandomness = uint256(keccak256(abi.encodePacked(blockhash(block.number - 1), tokenId))); uint256 backgroundCount = descriptor.backgroundCount(); uint256 bodyCount = descriptor.bodyCount(); uint256 accessoryCount = descriptor.accessoryCount(); uint256 headCount = descriptor.headCount(); uint256 eyesCount = descriptor.eyesCount(); uint256 glassesCount = descriptor.glassesCount(); return Seed({ background: uint48(uint48(pseudorandomness) % backgroundCount), body: uint48(uint48(pseudorandomness >> 48) % bodyCount), accessory: uint48(uint48(pseudorandomness >> 96) % accessoryCount), head: uint48(uint48(pseudorandomness >> 144) % headCount), eyes: uint48(uint48(pseudorandomness >> 192) % eyesCount), glasses: uint48(uint48(pseudorandomness) % glassesCount) }); } }
// SPDX-License-Identifier: GPL-3.0 /// @title Interface for Plutocats Descriptor Minimal pragma solidity >=0.8.0; import {IPlutocatsSeeder} from "./IPlutocatsSeeder.sol"; interface IPlutocatsDescriptorMinimal { /// /// USED BY TOKEN /// function tokenURI(uint256 tokenId, IPlutocatsSeeder.Seed memory seed) external view returns (string memory); function dataURI(uint256 tokenId, IPlutocatsSeeder.Seed memory seed) external view returns (string memory); /// /// USED BY SEEDER /// function backgroundCount() external view returns (uint256); function bodyCount() external view returns (uint256); function accessoryCount() external view returns (uint256); function headCount() external view returns (uint256); function eyesCount() external view returns (uint256); function glassesCount() external view returns (uint256); }
// SPDX-License-Identifier: GPL-3.0 /// @title Interface for Plutocats Seeder pragma solidity >=0.8.0; import {IPlutocatsDescriptorMinimal} from "./IPlutocatsDescriptorMinimal.sol"; interface IPlutocatsSeeder { struct Seed { uint48 background; uint48 body; uint48 accessory; uint48 head; uint48 eyes; uint48 glasses; } function generateSeed(uint256 tokenId, IPlutocatsDescriptorMinimal descriptor) external view returns (Seed memory); }
{ "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
[{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IPlutocatsDescriptorMinimal","name":"descriptor","type":"address"}],"name":"generateSeed","outputs":[{"components":[{"internalType":"uint48","name":"background","type":"uint48"},{"internalType":"uint48","name":"body","type":"uint48"},{"internalType":"uint48","name":"accessory","type":"uint48"},{"internalType":"uint48","name":"head","type":"uint48"},{"internalType":"uint48","name":"eyes","type":"uint48"},{"internalType":"uint48","name":"glasses","type":"uint48"}],"internalType":"struct IPlutocatsSeeder.Seed","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50610537806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063422e2e9914610030575b600080fd5b61004361003e366004610469565b6100ac565b6040516100a39190600060c08201905065ffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525092915050565b60405180910390f35b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101829052906100e96001436104a5565b604080519140602083015281018590526060016040516020818303038152906040528051906020012060001c90506000836001600160a01b0316634531c0a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610157573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017b91906104c6565b90506000846001600160a01b031663eba818066040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e191906104c6565b90506000856001600160a01b0316634daebac26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024791906104c6565b90506000866001600160a01b031663cc2aa0916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610289573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ad91906104c6565b90506000876001600160a01b0316638104468c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031391906104c6565b90506000886001600160a01b0316634479cef26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610355573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037991906104c6565b90506040518060c00160405280878965ffffffffffff1661039a91906104df565b65ffffffffffff1681526020018660308a901c65ffffffffffff166103bf91906104df565b65ffffffffffff1681526020018560608a901c65ffffffffffff166103e491906104df565b65ffffffffffff1681526020018460908a901c65ffffffffffff1661040991906104df565b65ffffffffffff1681526020018360c08a901c65ffffffffffff1661042e91906104df565b65ffffffffffff168152602001828965ffffffffffff1661044f91906104df565b65ffffffffffff1690529750505050505050505b92915050565b6000806040838503121561047c57600080fd5b8235915060208301356001600160a01b038116811461049a57600080fd5b809150509250929050565b8181038181111561046357634e487b7160e01b600052601160045260246000fd5b6000602082840312156104d857600080fd5b5051919050565b6000826104fc57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220780fea73412cd628edb7a23893ba9a859e7679390b21fe996c94c2490b5d190f64736f6c63430008130033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063422e2e9914610030575b600080fd5b61004361003e366004610469565b6100ac565b6040516100a39190600060c08201905065ffffffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525092915050565b60405180910390f35b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101829052906100e96001436104a5565b604080519140602083015281018590526060016040516020818303038152906040528051906020012060001c90506000836001600160a01b0316634531c0a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610157573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017b91906104c6565b90506000846001600160a01b031663eba818066040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e191906104c6565b90506000856001600160a01b0316634daebac26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024791906104c6565b90506000866001600160a01b031663cc2aa0916040518163ffffffff1660e01b8152600401602060405180830381865afa158015610289573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ad91906104c6565b90506000876001600160a01b0316638104468c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031391906104c6565b90506000886001600160a01b0316634479cef26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610355573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037991906104c6565b90506040518060c00160405280878965ffffffffffff1661039a91906104df565b65ffffffffffff1681526020018660308a901c65ffffffffffff166103bf91906104df565b65ffffffffffff1681526020018560608a901c65ffffffffffff166103e491906104df565b65ffffffffffff1681526020018460908a901c65ffffffffffff1661040991906104df565b65ffffffffffff1681526020018360c08a901c65ffffffffffff1661042e91906104df565b65ffffffffffff168152602001828965ffffffffffff1661044f91906104df565b65ffffffffffff1690529750505050505050505b92915050565b6000806040838503121561047c57600080fd5b8235915060208301356001600160a01b038116811461049a57600080fd5b809150509250929050565b8181038181111561046357634e487b7160e01b600052601160045260246000fd5b6000602082840312156104d857600080fd5b5051919050565b6000826104fc57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220780fea73412cd628edb7a23893ba9a859e7679390b21fe996c94c2490b5d190f64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.