More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 44,921 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Buy_plot | 18658356 | 362 days ago | IN | 0.16 ETH | 0.00341192 | ||||
Buy_plot | 18587936 | 372 days ago | IN | 0.16 ETH | 0.00296955 | ||||
Buy_plot | 18577881 | 373 days ago | IN | 0.16 ETH | 0.00333481 | ||||
Buy_plot | 18577610 | 373 days ago | IN | 0.16 ETH | 0.00267845 | ||||
Buy_plot | 18577378 | 373 days ago | IN | 0.16 ETH | 0.00433557 | ||||
Buy_plot | 18575751 | 374 days ago | IN | 0.16 ETH | 0.00304012 | ||||
Buy_plot | 18575356 | 374 days ago | IN | 0.16 ETH | 0.00224953 | ||||
Buy_plot | 18574186 | 374 days ago | IN | 0.16 ETH | 0.00351851 | ||||
Buy_plot | 18573166 | 374 days ago | IN | 0.16 ETH | 0.00212543 | ||||
Buy_plot | 18573152 | 374 days ago | IN | 0.16 ETH | 0.00273506 | ||||
Buy_plot | 18572008 | 374 days ago | IN | 0.16 ETH | 0.00653401 | ||||
Buy_plot | 18571926 | 374 days ago | IN | 0.16 ETH | 0.00632324 | ||||
Buy_plot | 18571441 | 374 days ago | IN | 0.16 ETH | 0.00423293 | ||||
Buy_plot | 18571436 | 374 days ago | IN | 0.16 ETH | 0.00425629 | ||||
Buy_plot | 18571435 | 374 days ago | IN | 0.16 ETH | 0.00408444 | ||||
Buy_plot | 18571433 | 374 days ago | IN | 0.16 ETH | 0.00418798 | ||||
Buy_plot | 18571432 | 374 days ago | IN | 0.16 ETH | 0.00443029 | ||||
Buy_plot | 18571428 | 374 days ago | IN | 0.16 ETH | 0.00391619 | ||||
Buy_plot | 18571424 | 374 days ago | IN | 0.16 ETH | 0.00367712 | ||||
Buy_plot | 18571423 | 374 days ago | IN | 0.16 ETH | 0.0037146 | ||||
Buy_plot | 18571422 | 374 days ago | IN | 0.16 ETH | 0.00370601 | ||||
Buy_plot | 18571420 | 374 days ago | IN | 0.16 ETH | 0.00368249 | ||||
Buy_plot | 18571404 | 374 days ago | IN | 0.16 ETH | 0.00365385 | ||||
Buy_plot | 18571396 | 374 days ago | IN | 0.16 ETH | 0.00345637 | ||||
Buy_plot | 18571395 | 374 days ago | IN | 0.16 ETH | 0.00338682 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
18658356 | 362 days ago | 0.04 ETH | ||||
18658356 | 362 days ago | 0.12 ETH | ||||
18587936 | 372 days ago | 0.04 ETH | ||||
18587936 | 372 days ago | 0.12 ETH | ||||
18577881 | 373 days ago | 0.04 ETH | ||||
18577881 | 373 days ago | 0.12 ETH | ||||
18577610 | 373 days ago | 0.04 ETH | ||||
18577610 | 373 days ago | 0.12 ETH | ||||
18577378 | 373 days ago | 0.04 ETH | ||||
18577378 | 373 days ago | 0.12 ETH | ||||
18575751 | 374 days ago | 0.04 ETH | ||||
18575751 | 374 days ago | 0.12 ETH | ||||
18575356 | 374 days ago | 0.04 ETH | ||||
18575356 | 374 days ago | 0.12 ETH | ||||
18574186 | 374 days ago | 0.04 ETH | ||||
18574186 | 374 days ago | 0.12 ETH | ||||
18573166 | 374 days ago | 0.04 ETH | ||||
18573166 | 374 days ago | 0.12 ETH | ||||
18573152 | 374 days ago | 0.04 ETH | ||||
18573152 | 374 days ago | 0.12 ETH | ||||
18572008 | 374 days ago | 0.04 ETH | ||||
18572008 | 374 days ago | 0.12 ETH | ||||
18571926 | 374 days ago | 0.04 ETH | ||||
18571926 | 374 days ago | 0.12 ETH | ||||
18571441 | 374 days ago | 0.04 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Grid
Compiler Version
vyper:0.3.9
Contract Source Code (Vyper language format)
# @version ^0.3.9 # @title Grid from vyper.interfaces import ERC20Detailed struct Plot: owner: address purchase_count: uint256 grid: public(HashMap[uint256, Plot]) BASE_PRICE: constant(uint256) = 10 ** 16 plots_owned: public(HashMap[address, uint256]) treasury: public(address) token: public(immutable(address)) mint_per_plot: immutable(uint256) interface MintableToken: def mint(to: address, amount: uint256): nonpayable event PlotPurchase: buyer: indexed(address) coord: indexed(uint256) price: uint256 purchase_count: uint256 @external def __init__(treasury: address, _token: address): self.treasury = treasury token = _token mint_per_plot = 100 * 10 ** convert(ERC20Detailed(token).decimals(), uint256) @payable @external def buy_plot(coord: uint256): assert coord < 10000, "Invalid coord" # plot price increases by 2x each time it is purchased plot_price: uint256 = BASE_PRICE * (2 ** self.grid[coord].purchase_count) current_owner: address = self.grid[coord].owner assert msg.value >= plot_price, "Not enough ETH sent to buy plot" if msg.value > plot_price: send(msg.sender, msg.value - plot_price) # protocol takes 25% of the purchase price # 75% goes to the previous owner # if there is no previous owner, 100% goes to the protocol # the protocol is the owner of all plots at the start if current_owner != ZERO_ADDRESS: send(current_owner, plot_price * 3 / 4) if current_owner != msg.sender: self.plots_owned[current_owner] -= 1 self.plots_owned[msg.sender] += 1 self.grid[coord].owner = msg.sender else: self.grid[coord].owner = msg.sender self.plots_owned[msg.sender] += 1 send(self.treasury, self.balance) self.grid[coord].purchase_count += 1 # mint tokens for the buyer MintableToken(token).mint(msg.sender, mint_per_plot) log PlotPurchase(msg.sender, coord, plot_price, self.grid[coord].purchase_count) @view @external def get_all_owners(start_index: uint256 = 0, end_index: uint256 = 10000) -> DynArray[address, 10000]: owners: DynArray[address, 10000] = [] for coord in range(start_index, start_index + 10000): if coord >= end_index: break owners.append(self.grid[coord].owner) return owners @view @external def get_all_purchase_counts(start_index: uint256 = 0, end_index: uint256 = 10000) -> DynArray[uint256, 10000]: purchase_counts: DynArray[uint256, 10000] = [] for coord in range(start_index, start_index + 10000): if coord >= end_index: break purchase_counts.append(self.grid[coord].purchase_count) return purchase_counts @view @external def price(coord: uint256) -> uint256: return BASE_PRICE * (2 ** self.grid[coord].purchase_count)
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"name":"PlotPurchase","inputs":[{"name":"buyer","type":"address","indexed":true},{"name":"coord","type":"uint256","indexed":true},{"name":"price","type":"uint256","indexed":false},{"name":"purchase_count","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"treasury","type":"address"},{"name":"_token","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"function","name":"buy_plot","inputs":[{"name":"coord","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"get_all_owners","inputs":[],"outputs":[{"name":"","type":"address[]"}]},{"stateMutability":"view","type":"function","name":"get_all_owners","inputs":[{"name":"start_index","type":"uint256"}],"outputs":[{"name":"","type":"address[]"}]},{"stateMutability":"view","type":"function","name":"get_all_owners","inputs":[{"name":"start_index","type":"uint256"},{"name":"end_index","type":"uint256"}],"outputs":[{"name":"","type":"address[]"}]},{"stateMutability":"view","type":"function","name":"get_all_purchase_counts","inputs":[],"outputs":[{"name":"","type":"uint256[]"}]},{"stateMutability":"view","type":"function","name":"get_all_purchase_counts","inputs":[{"name":"start_index","type":"uint256"}],"outputs":[{"name":"","type":"uint256[]"}]},{"stateMutability":"view","type":"function","name":"get_all_purchase_counts","inputs":[{"name":"start_index","type":"uint256"},{"name":"end_index","type":"uint256"}],"outputs":[{"name":"","type":"uint256[]"}]},{"stateMutability":"view","type":"function","name":"price","inputs":[{"name":"coord","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"grid","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"owner","type":"address"},{"name":"purchase_count","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"plots_owned","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"treasury","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"token","inputs":[],"outputs":[{"name":"","type":"address"}]}]
Contract Creation Code
61069a5150602061072f5f395f518060a01c61072b57604052602061074f5f395f518060a01c61072b576060523461072b5760405160025560605161067a5261067a5163313ce567608052602060806004609c845afa610061573d5f5f3e3d5ffd5b60203d1061072b576080518060081c61072b5760c05260c0905051604d811161072b5780600a0a90506064810281606482041861072b57905061069a5261067a6100b0610000396106ba610000f36003361161000c57610665565b5f3560e01c637ebbc07381186102e157602436106106695761270f600435111561008b57600d6040527f496e76616c696420636f6f72640000000000000000000000000000000000000060605260405060405180606001601f825f031636823750506308c379a05f526020602052601f19601f6040510116604401601cfd5b5f6004356020525f5260405f206001810190505460ff8111610669578060020a9050662386f26fc10000810281662386f26fc100008204186106695790506040525f6004356020525f5260405f205460605260405134101561014357601f6080527f4e6f7420656e6f756768204554482073656e7420746f2062757920706c6f740060a0526080506080518060a001601f825f031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b60405134111561016c575f5f5f5f346040518082038281116106695790509050335ff115610669575b606051156101f6575f5f5f5f604051600381028160038204186106695790508060021c90506060515ff1156106695733606051146102245760016060516020525f5260405f208054600181038181116106695790508155506001336020525f5260405f20805460018101818110610669579050815550335f6004356020525f5260405f2055610224565b335f6004356020525f5260405f20556001336020525f5260405f208054600181018181106106695790508155505b5f5f5f5f476002545ff115610669575f6004356020525f5260405f20600181019050805460018101818110610669579050815550602061067a5f395f516340c10f196080523360a052602061069a5f395f5160c052803b15610669575f60806044609c5f855af1610297573d5f5f3e3d5ffd5b50600435337f14db01fe08572ad26302b5a12b63a01239bdb7aa9ebf319bd9662286dd3c69976040516080525f6004356020525f5260405f206001810190505460a05260406080a3005b34610669576351d2cc8f811861031a5760243610610669575f6004356020525f5260405f20805460405260018101546060525060406040f35b63a05befd081186103535760243610610669576004358060a01c6106695760405260016040516020525f5260405f205460605260206060f35b6361d027b3811861036a5760025460405260206040f35b63fc0c546a811861038757602061067a5f395f5160405260206040f35b63c7d7db0581186103a1575f6040526127106060526103e0565b63a5b7793a81186103c55760243610610669576004356040526127106060526103e0565b632eb4e4a281186104c5576044361061066957604060046040375b5f6080526040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd8f08111610669576127108101905b806204e2a0526060516204e2a0511061042d57610464565b60805161270f8111610669575f6204e2a0516020525f5260405f20548160051b60a001526001810160805250600101818118610415575b50506020806204e2a052806204e2a0015f6080518083528060051b5f8261271081116106695780156104af57905b8060051b60a001518160051b602088010152600101818118610492575b505082016020019150509050810190506204e2a0f35b6372f545de81186104df575f60405261271060605261051e565b639bed5770811861050357602436106106695760043560405261271060605261051e565b63481452448118610609576044361061066957604060046040375b5f6080526040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd8f08111610669576127108101905b806204e2a0526060516204e2a0511061056b576105a8565b60805161270f8111610669575f6204e2a0516020525f5260405f20600181019050548160051b60a001526001810160805250600101818118610553575b50506020806204e2a052806204e2a0015f6080518083528060051b5f8261271081116106695780156105f357905b8060051b60a001518160051b6020880101526001018181186105d6575b505082016020019150509050810190506204e2a0f35b6326a49e3781186106635760243610610669575f6004356020525f5260405f206001810190505460ff8111610669578060020a9050662386f26fc10000810281662386f26fc1000082041861066957905060405260206040f35b505b5f5ffd5b5f80fda165767970657283000309000b005b5f80fd000000000000000000000000055d0f4ab9922c006220e32b75cf02083c955e93000000000000000000000000ce96cc49a25e8c1e6e380f8ab4b64dff188fd035
Deployed Bytecode
0x6003361161000c57610665565b5f3560e01c637ebbc07381186102e157602436106106695761270f600435111561008b57600d6040527f496e76616c696420636f6f72640000000000000000000000000000000000000060605260405060405180606001601f825f031636823750506308c379a05f526020602052601f19601f6040510116604401601cfd5b5f6004356020525f5260405f206001810190505460ff8111610669578060020a9050662386f26fc10000810281662386f26fc100008204186106695790506040525f6004356020525f5260405f205460605260405134101561014357601f6080527f4e6f7420656e6f756768204554482073656e7420746f2062757920706c6f740060a0526080506080518060a001601f825f031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b60405134111561016c575f5f5f5f346040518082038281116106695790509050335ff115610669575b606051156101f6575f5f5f5f604051600381028160038204186106695790508060021c90506060515ff1156106695733606051146102245760016060516020525f5260405f208054600181038181116106695790508155506001336020525f5260405f20805460018101818110610669579050815550335f6004356020525f5260405f2055610224565b335f6004356020525f5260405f20556001336020525f5260405f208054600181018181106106695790508155505b5f5f5f5f476002545ff115610669575f6004356020525f5260405f20600181019050805460018101818110610669579050815550602061067a5f395f516340c10f196080523360a052602061069a5f395f5160c052803b15610669575f60806044609c5f855af1610297573d5f5f3e3d5ffd5b50600435337f14db01fe08572ad26302b5a12b63a01239bdb7aa9ebf319bd9662286dd3c69976040516080525f6004356020525f5260405f206001810190505460a05260406080a3005b34610669576351d2cc8f811861031a5760243610610669575f6004356020525f5260405f20805460405260018101546060525060406040f35b63a05befd081186103535760243610610669576004358060a01c6106695760405260016040516020525f5260405f205460605260206060f35b6361d027b3811861036a5760025460405260206040f35b63fc0c546a811861038757602061067a5f395f5160405260206040f35b63c7d7db0581186103a1575f6040526127106060526103e0565b63a5b7793a81186103c55760243610610669576004356040526127106060526103e0565b632eb4e4a281186104c5576044361061066957604060046040375b5f6080526040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd8f08111610669576127108101905b806204e2a0526060516204e2a0511061042d57610464565b60805161270f8111610669575f6204e2a0516020525f5260405f20548160051b60a001526001810160805250600101818118610415575b50506020806204e2a052806204e2a0015f6080518083528060051b5f8261271081116106695780156104af57905b8060051b60a001518160051b602088010152600101818118610492575b505082016020019150509050810190506204e2a0f35b6372f545de81186104df575f60405261271060605261051e565b639bed5770811861050357602436106106695760043560405261271060605261051e565b63481452448118610609576044361061066957604060046040375b5f6080526040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd8f08111610669576127108101905b806204e2a0526060516204e2a0511061056b576105a8565b60805161270f8111610669575f6204e2a0516020525f5260405f20600181019050548160051b60a001526001810160805250600101818118610553575b50506020806204e2a052806204e2a0015f6080518083528060051b5f8261271081116106695780156105f357905b8060051b60a001518160051b6020880101526001018181186105d6575b505082016020019150509050810190506204e2a0f35b6326a49e3781186106635760243610610669575f6004356020525f5260405f206001810190505460ff8111610669578060020a9050662386f26fc10000810281662386f26fc1000082041861066957905060405260206040f35b505b5f5ffd5b5f80fda165767970657283000309000b000000000000000000000000ce96cc49a25e8c1e6e380f8ab4b64dff188fd0350000000000000000000000000000000000000000000000056bc75e2d63100000
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000055d0f4ab9922c006220e32b75cf02083c955e93000000000000000000000000ce96cc49a25e8c1e6e380f8ab4b64dff188fd035
-----Decoded View---------------
Arg [0] : treasury (address): 0x055D0F4ab9922c006220E32b75cF02083c955e93
Arg [1] : _token (address): 0xCe96cc49a25e8C1E6E380F8Ab4B64DFF188fd035
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000055d0f4ab9922c006220e32b75cf02083c955e93
Arg [1] : 000000000000000000000000ce96cc49a25e8c1e6e380f8ab4b64dff188fd035
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.