Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- Migration
- Optimization enabled
- false
- Compiler version
- v0.8.19+commit.7dd6d404
- EVM Version
- default
- Verified at
- 2024-09-26T15:32:59.788127Z
Contract source code
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface INFT { function ownerOf(uint256 id) external view returns(address); function getClassForTokenID(uint256 id) external view returns(uint256); } contract Migration { struct NFT { address owner; uint256 class; } INFT constant public nft = INFT(0x9C02E4aEb4a29084553b5Fdc3B5f6DF72F11E104); mapping(address user => uint256[] tokens) public users; function snapshot() external view returns(NFT[253] memory nfts) { for (uint i; i<253; i++) { nfts[i].owner = nft.ownerOf(i); nfts[i].class = nft.getClassForTokenID(i); } } uint256 public start; function record(uint len) external { len = start + len; uint i = start; if (len > 253) len = 253; for (; i<len; i++) { address owner = nft.ownerOf(i); uint256 class = nft.getClassForTokenID(i); users[owner].push(class); } start = i; } function getCalsses(address user) external view returns(uint256[] memory classes) { return users[user]; } }
Contract ABI
[{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"classes","internalType":"uint256[]"}],"name":"getCalsses","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract INFT"}],"name":"nft","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"record","inputs":[{"type":"uint256","name":"len","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[253]","name":"nfts","internalType":"struct Migration.NFT[253]","components":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"class","internalType":"uint256"}]}],"name":"snapshot","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"start","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"tokens","internalType":"uint256"}],"name":"users","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50610b4d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80632c16cd8a1461006757806347ccca021461008357806354a02f9e146100a15780639711715a146100d1578063be9a6555146100ef578063cfea626c1461010d575b600080fd5b610081600480360381019061007c9190610647565b61013d565b005b61008b610314565b60405161009891906106f3565b60405180910390f35b6100bb60048036038101906100b6919061074c565b61032c565b6040516100c8919061079b565b60405180910390f35b6100d961035d565b6040516100e6919061089f565b60405180910390f35b6100f7610512565b604051610104919061079b565b60405180910390f35b610127600480360381019061012291906108bb565b610518565b6040516101349190610997565b60405180910390f35b8060015461014b91906109e8565b90506000600154905060fd8211156101625760fd91505b5b81811015610309576000739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016101ba919061079b565b602060405180830381865afa1580156101d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fb9190610a31565b90506000739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff1663543dc7fa846040518263ffffffff1660e01b815260040161024c919061079b565b602060405180830381865afa158015610269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028d9190610a73565b90506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190806001815401808255809150506001900390600052602060002001600090919091909150555050808061030190610aa0565b915050610163565b806001819055505050565b739c02e4aeb4a29084553b5fdc3b5f6df72f11e10481565b6000602052816000526040600020818154811061034857600080fd5b90600052602060002001600091509150505481565b6103656105ae565b60005b60fd81101561050e57739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff16636352211e826040518263ffffffff1660e01b81526004016103be919061079b565b602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190610a31565b828260fd811061041257610411610ae8565b5b60200201516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff1663543dc7fa826040518263ffffffff1660e01b815260040161049a919061079b565b602060405180830381865afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190610a73565b828260fd81106104ee576104ed610ae8565b5b60200201516020018181525050808061050690610aa0565b915050610368565b5090565b60015481565b60606000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156105a257602002820191906000526020600020905b81548152602001906001019080831161058e575b50505050509050919050565b60405180611fa0016040528060fd905b6105c66105dc565b8152602001906001900390816105be5790505090565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b600080fd5b6000819050919050565b61062481610611565b811461062f57600080fd5b50565b6000813590506106418161061b565b92915050565b60006020828403121561065d5761065c61060c565b5b600061066b84828501610632565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006106b96106b46106af84610674565b610694565b610674565b9050919050565b60006106cb8261069e565b9050919050565b60006106dd826106c0565b9050919050565b6106ed816106d2565b82525050565b600060208201905061070860008301846106e4565b92915050565b600061071982610674565b9050919050565b6107298161070e565b811461073457600080fd5b50565b60008135905061074681610720565b92915050565b600080604083850312156107635761076261060c565b5b600061077185828601610737565b925050602061078285828601610632565b9150509250929050565b61079581610611565b82525050565b60006020820190506107b0600083018461078c565b92915050565b600060fd9050919050565b600081905092915050565b6000819050919050565b6107df8161070e565b82525050565b6107ee81610611565b82525050565b60408201600082015161080a60008501826107d6565b50602082015161081d60208501826107e5565b50505050565b600061082f83836107f4565b60408301905092915050565b6000602082019050919050565b610851816107b6565b61085b81846107c1565b9250610866826107cc565b8060005b8381101561089757815161087e8782610823565b96506108898361083b565b92505060018101905061086a565b505050505050565b6000613f40820190506108b56000830184610848565b92915050565b6000602082840312156108d1576108d061060c565b5b60006108df84828501610737565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061092083836107e5565b60208301905092915050565b6000602082019050919050565b6000610944826108e8565b61094e81856108f3565b935061095983610904565b8060005b8381101561098a5781516109718882610914565b975061097c8361092c565b92505060018101905061095d565b5085935050505092915050565b600060208201905081810360008301526109b18184610939565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109f382610611565b91506109fe83610611565b9250828201905080821115610a1657610a156109b9565b5b92915050565b600081519050610a2b81610720565b92915050565b600060208284031215610a4757610a4661060c565b5b6000610a5584828501610a1c565b91505092915050565b600081519050610a6d8161061b565b92915050565b600060208284031215610a8957610a8861060c565b5b6000610a9784828501610a5e565b91505092915050565b6000610aab82610611565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610add57610adc6109b9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220d9fe841a7ed40ad17565195fd5a95ee8eb386329124c7078b6d3506d96993d9164736f6c63430008130033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632c16cd8a1461006757806347ccca021461008357806354a02f9e146100a15780639711715a146100d1578063be9a6555146100ef578063cfea626c1461010d575b600080fd5b610081600480360381019061007c9190610647565b61013d565b005b61008b610314565b60405161009891906106f3565b60405180910390f35b6100bb60048036038101906100b6919061074c565b61032c565b6040516100c8919061079b565b60405180910390f35b6100d961035d565b6040516100e6919061089f565b60405180910390f35b6100f7610512565b604051610104919061079b565b60405180910390f35b610127600480360381019061012291906108bb565b610518565b6040516101349190610997565b60405180910390f35b8060015461014b91906109e8565b90506000600154905060fd8211156101625760fd91505b5b81811015610309576000739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016101ba919061079b565b602060405180830381865afa1580156101d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fb9190610a31565b90506000739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff1663543dc7fa846040518263ffffffff1660e01b815260040161024c919061079b565b602060405180830381865afa158015610269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028d9190610a73565b90506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190806001815401808255809150506001900390600052602060002001600090919091909150555050808061030190610aa0565b915050610163565b806001819055505050565b739c02e4aeb4a29084553b5fdc3b5f6df72f11e10481565b6000602052816000526040600020818154811061034857600080fd5b90600052602060002001600091509150505481565b6103656105ae565b60005b60fd81101561050e57739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff16636352211e826040518263ffffffff1660e01b81526004016103be919061079b565b602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190610a31565b828260fd811061041257610411610ae8565b5b60200201516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050739c02e4aeb4a29084553b5fdc3b5f6df72f11e10473ffffffffffffffffffffffffffffffffffffffff1663543dc7fa826040518263ffffffff1660e01b815260040161049a919061079b565b602060405180830381865afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190610a73565b828260fd81106104ee576104ed610ae8565b5b60200201516020018181525050808061050690610aa0565b915050610368565b5090565b60015481565b60606000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156105a257602002820191906000526020600020905b81548152602001906001019080831161058e575b50505050509050919050565b60405180611fa0016040528060fd905b6105c66105dc565b8152602001906001900390816105be5790505090565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b600080fd5b6000819050919050565b61062481610611565b811461062f57600080fd5b50565b6000813590506106418161061b565b92915050565b60006020828403121561065d5761065c61060c565b5b600061066b84828501610632565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006106b96106b46106af84610674565b610694565b610674565b9050919050565b60006106cb8261069e565b9050919050565b60006106dd826106c0565b9050919050565b6106ed816106d2565b82525050565b600060208201905061070860008301846106e4565b92915050565b600061071982610674565b9050919050565b6107298161070e565b811461073457600080fd5b50565b60008135905061074681610720565b92915050565b600080604083850312156107635761076261060c565b5b600061077185828601610737565b925050602061078285828601610632565b9150509250929050565b61079581610611565b82525050565b60006020820190506107b0600083018461078c565b92915050565b600060fd9050919050565b600081905092915050565b6000819050919050565b6107df8161070e565b82525050565b6107ee81610611565b82525050565b60408201600082015161080a60008501826107d6565b50602082015161081d60208501826107e5565b50505050565b600061082f83836107f4565b60408301905092915050565b6000602082019050919050565b610851816107b6565b61085b81846107c1565b9250610866826107cc565b8060005b8381101561089757815161087e8782610823565b96506108898361083b565b92505060018101905061086a565b505050505050565b6000613f40820190506108b56000830184610848565b92915050565b6000602082840312156108d1576108d061060c565b5b60006108df84828501610737565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061092083836107e5565b60208301905092915050565b6000602082019050919050565b6000610944826108e8565b61094e81856108f3565b935061095983610904565b8060005b8381101561098a5781516109718882610914565b975061097c8361092c565b92505060018101905061095d565b5085935050505092915050565b600060208201905081810360008301526109b18184610939565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109f382610611565b91506109fe83610611565b9250828201905080821115610a1657610a156109b9565b5b92915050565b600081519050610a2b81610720565b92915050565b600060208284031215610a4757610a4661060c565b5b6000610a5584828501610a1c565b91505092915050565b600081519050610a6d8161061b565b92915050565b600060208284031215610a8957610a8861060c565b5b6000610a9784828501610a5e565b91505092915050565b6000610aab82610611565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610add57610adc6109b9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220d9fe841a7ed40ad17565195fd5a95ee8eb386329124c7078b6d3506d96993d9164736f6c63430008130033