ETH Price: $3,358.23 (+1.01%)

Contract

0xB1e69773b35a7785A87deA6f010AF155102F282D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Buy_plot186583562023-11-26 20:55:11362 days ago1701032111IN
0xB1e69773...5102F282D
0.16 ETH0.0034119229.1792049
Buy_plot185879362023-11-17 0:10:59372 days ago1700179859IN
0xB1e69773...5102F282D
0.16 ETH0.0029695525.39604063
Buy_plot185778812023-11-15 14:28:23373 days ago1700058503IN
0xB1e69773...5102F282D
0.16 ETH0.0033348140.30958272
Buy_plot185776102023-11-15 13:33:23373 days ago1700055203IN
0xB1e69773...5102F282D
0.16 ETH0.0026784532.37585791
Buy_plot185773782023-11-15 12:46:47373 days ago1700052407IN
0xB1e69773...5102F282D
0.16 ETH0.0043355737.07842114
Buy_plot185757512023-11-15 7:17:23374 days ago1700032643IN
0xB1e69773...5102F282D
0.16 ETH0.0030401225.9994905
Buy_plot185753562023-11-15 5:57:35374 days ago1700027855IN
0xB1e69773...5102F282D
0.16 ETH0.0022495327.19131028
Buy_plot185741862023-11-15 2:01:59374 days ago1700013719IN
0xB1e69773...5102F282D
0.16 ETH0.0035185130.09081454
Buy_plot185731662023-11-14 22:36:35374 days ago1700001395IN
0xB1e69773...5102F282D
0.16 ETH0.0021254331.70729899
Buy_plot185731522023-11-14 22:33:47374 days ago1700001227IN
0xB1e69773...5102F282D
0.16 ETH0.0027350632.50879646
Buy_plot185720082023-11-14 18:43:35374 days ago1699987415IN
0xB1e69773...5102F282D
0.16 ETH0.0065340155.87967597
Buy_plot185719262023-11-14 18:26:47374 days ago1699986407IN
0xB1e69773...5102F282D
0.16 ETH0.0063232454.08274007
Buy_plot185714412023-11-14 16:49:23374 days ago1699980563IN
0xB1e69773...5102F282D
0.16 ETH0.0042329351.1657173
Buy_plot185714362023-11-14 16:48:23374 days ago1699980503IN
0xB1e69773...5102F282D
0.16 ETH0.0042562951.44808362
Buy_plot185714352023-11-14 16:48:11374 days ago1699980491IN
0xB1e69773...5102F282D
0.16 ETH0.0040844449.37073376
Buy_plot185714332023-11-14 16:47:47374 days ago1699980467IN
0xB1e69773...5102F282D
0.16 ETH0.0041879850.62229628
Buy_plot185714322023-11-14 16:47:35374 days ago1699980455IN
0xB1e69773...5102F282D
0.16 ETH0.0044302953.55129044
Buy_plot185714282023-11-14 16:46:47374 days ago1699980407IN
0xB1e69773...5102F282D
0.16 ETH0.0039161947.33704868
Buy_plot185714242023-11-14 16:45:59374 days ago1699980359IN
0xB1e69773...5102F282D
0.16 ETH0.0036771244.44724977
Buy_plot185714232023-11-14 16:45:47374 days ago1699980347IN
0xB1e69773...5102F282D
0.16 ETH0.003714644.90028409
Buy_plot185714222023-11-14 16:45:35374 days ago1699980335IN
0xB1e69773...5102F282D
0.16 ETH0.0037060144.79649589
Buy_plot185714202023-11-14 16:45:11374 days ago1699980311IN
0xB1e69773...5102F282D
0.16 ETH0.0036824944.51225878
Buy_plot185714042023-11-14 16:41:47374 days ago1699980107IN
0xB1e69773...5102F282D
0.16 ETH0.0036538544.16596898
Buy_plot185713962023-11-14 16:40:11374 days ago1699980011IN
0xB1e69773...5102F282D
0.16 ETH0.0034563744.35235794
Buy_plot185713952023-11-14 16:39:59374 days ago1699979999IN
0xB1e69773...5102F282D
0.16 ETH0.0033868243.45983701
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
186583562023-11-26 20:55:11362 days ago1701032111
0xB1e69773...5102F282D
0.04 ETH
186583562023-11-26 20:55:11362 days ago1701032111
0xB1e69773...5102F282D
0.12 ETH
185879362023-11-17 0:10:59372 days ago1700179859
0xB1e69773...5102F282D
0.04 ETH
185879362023-11-17 0:10:59372 days ago1700179859
0xB1e69773...5102F282D
0.12 ETH
185778812023-11-15 14:28:23373 days ago1700058503
0xB1e69773...5102F282D
0.04 ETH
185778812023-11-15 14:28:23373 days ago1700058503
0xB1e69773...5102F282D
0.12 ETH
185776102023-11-15 13:33:23373 days ago1700055203
0xB1e69773...5102F282D
0.04 ETH
185776102023-11-15 13:33:23373 days ago1700055203
0xB1e69773...5102F282D
0.12 ETH
185773782023-11-15 12:46:47373 days ago1700052407
0xB1e69773...5102F282D
0.04 ETH
185773782023-11-15 12:46:47373 days ago1700052407
0xB1e69773...5102F282D
0.12 ETH
185757512023-11-15 7:17:23374 days ago1700032643
0xB1e69773...5102F282D
0.04 ETH
185757512023-11-15 7:17:23374 days ago1700032643
0xB1e69773...5102F282D
0.12 ETH
185753562023-11-15 5:57:35374 days ago1700027855
0xB1e69773...5102F282D
0.04 ETH
185753562023-11-15 5:57:35374 days ago1700027855
0xB1e69773...5102F282D
0.12 ETH
185741862023-11-15 2:01:59374 days ago1700013719
0xB1e69773...5102F282D
0.04 ETH
185741862023-11-15 2:01:59374 days ago1700013719
0xB1e69773...5102F282D
0.12 ETH
185731662023-11-14 22:36:35374 days ago1700001395
0xB1e69773...5102F282D
0.04 ETH
185731662023-11-14 22:36:35374 days ago1700001395
0xB1e69773...5102F282D
0.12 ETH
185731522023-11-14 22:33:47374 days ago1700001227
0xB1e69773...5102F282D
0.04 ETH
185731522023-11-14 22:33:47374 days ago1700001227
0xB1e69773...5102F282D
0.12 ETH
185720082023-11-14 18:43:35374 days ago1699987415
0xB1e69773...5102F282D
0.04 ETH
185720082023-11-14 18:43:35374 days ago1699987415
0xB1e69773...5102F282D
0.12 ETH
185719262023-11-14 18:26:47374 days ago1699986407
0xB1e69773...5102F282D
0.04 ETH
185719262023-11-14 18:26:47374 days ago1699986407
0xB1e69773...5102F282D
0.12 ETH
185714412023-11-14 16:49:23374 days ago1699980563
0xB1e69773...5102F282D
0.04 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Grid

Compiler Version
vyper:0.3.9

Optimization Enabled:
N/A

Other Settings:
MIT license

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

Contract ABI

[{"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"}]}]

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.