Contract 0xcf546C672049C4CC3235F0B2B6983a0F217F6c48

 
 
Txn Hash
Method
Block
From
To
Value
0x4bed0091548ff8915bd7820b805b42ebc41849e5335d83d755975f219e86fdc60x34610ad1156394282022-09-29 13:54:3559 days 5 hrs agoENS Name bitbanter.eth IN  Create: Vyper_contract0 Ether0.01347738 20.27492101
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.7

Optimization Enabled:
N/A

Other Settings:
None license

Contract Source Code (Vyper language format)

# @version >=0.3.7
"""
@title Where in the World is Kwon Zhu Davieago?
@dev Introducing my new gps web3 game. It's simple.
@dev Send 0.1 ETH, a lat-long coordinate, and the addr of the front-end you used.
@dev Congrats you are now the mayor of lat-long.
@dev If Kwon, Zhu, or Davies reemerges publicly and you're closest to them, congrats! You win a 1/6th of the pot for each.
@dev 40% goes to charities. 5% to the front end provider with the most entries. 5% to me for more smart contract bullshit.
@dev This is an insane, untested contract.
@author Josh Cincinnati (github: @acityinohio, website: https://bitbanter.com/)
"""

############### variables ###############
# the contract owner
owner: public(address)

# whether the game has ended (defaults to false)
ended: public(bool)

# struct of guesser/front end
struct GF:
	guesser: address
	front: address

# map of guesses, lat, long,
guesses: HashMap[int128, HashMap[int128, GF]]

# do winner
kwon: address

# su winner
zhu: address

# kyle winner
davies: address

# frontend winner
front: address

############### events ###############
# when someone says governance and we nuke everything, as a treat
event SomeoneSaidGovernance: pass

# new guess
event NewGuess:
	lat: int128
	long: int128
	guesser: address
	front: address

# various winners
event FoundDo:
	lat: int128
	long: int128
	kwonFinder: address

event FoundSu:
	lat: int128
	long: int128
	zhuFinder: address

event FoundKyle:
	lat: int128
	long: int128
	daviesFinder: address

############### init and internal functions ###############

@external
def __init__():
	"""
	@dev contract initialization on deployment
	@dev set sender as owner
	"""
	self.owner = msg.sender


############### other functions ###############

@external
@payable
def makeGuess(lat: int128, long: int128, frontend: address):
	"""
	@dev become mayor of a lat-long!
	"""
	assert msg.value == as_wei_value(0.1, "ether"), "You can only send 0.1 ETH"
	assert self.guesses[lat][long].guesser == empty(address), "Someone is already mayor"
	assert lat >= -90 and lat <= 90, "Latitude must be integer between -90 and 90"
	assert long >= -180 and long <= 180, "Longitude must be integer between -180 and 180"
	self.guesses[lat][long] = GF({guesser: msg.sender, front: frontend})
	log NewGuess(lat, long, msg.sender, frontend)

@external
def doWinner(lat: int128, long: int128):
	"""
	@dev using the magic of off-chain computation, we define the Do winner
	@dev based on coordinate pair
	"""
	assert msg.sender == self.owner, "You must be owner to define the winner"
	assert self.guesses[lat][long].guesser != empty(address), "no guess at this lat/long"
	self.kwon = self.guesses[lat][long].guesser
	log FoundDo(lat, long, self.kwon)

@external
def suWinner(lat: int128, long: int128):
	"""
	@dev using the magic of off-chain computation, we define the Su winner
	@dev based on coordinate pair
	"""
	assert msg.sender == self.owner, "You must be owner to define the winner"
	assert self.guesses[lat][long].guesser != empty(address), "no guess at this lat/long"
	self.zhu = self.guesses[lat][long].guesser
	log FoundSu(lat, long, self.zhu)

@external
def kyleWinner(lat: int128, long: int128):
	"""
	@dev using the magic of off-chain computation, we define the Kyle winner
	@dev based on coordinate pair
	"""
	assert msg.sender == self.owner, "You must be owner to define the winner"
	assert self.guesses[lat][long].guesser != empty(address), "no guess at this lat/long"
	self.davies = self.guesses[lat][long].guesser
	log FoundKyle(lat, long, self.davies)

@external
def playUsOutKeyboardCat(frontend: address):
	"""
	@dev GAME OVER MAN, GAME OVER
	"""
	assert msg.sender == self.owner, "You must be the owner blah blah blah"
	assert self.davies != empty(address) and self.zhu != empty(address) and self.kwon != empty(address), "winners must be decided"
	### pay everyone out
	# for the good people doing good things
	high_five: uint256 = self.balance/10
	# congrats on guessing Dubai or Singapore
	winner_pot: uint256 = self.balance/6
	# frontend winner
	frontend_pot: uint256 = self.balance/20
	# look at us, funding good things non-quadratically
	# zachxbt
	send(0x9D727911B54C455B0071A7B682FcF4Bc444B5596, high_five)
	# coin center
	send(0x15322B546e31F5Bfe144C4ae133A9Db6F0059fe3, high_five)
	# give directly
	send(0x750EF1D7a0b4Ab1c97B7A623D7917CcEb5ea779C, high_five)
	# internet archive
	send(0xFA8E3920daF271daB92Be9B87d9998DDd94FEF08, high_five)
	# winners!
	send(self.kwon, winner_pot)
	send(self.zhu, winner_pot)
	send(self.davies, winner_pot)
	# front ender
	send(frontend, frontend_pot)
	# thanks for playing
	selfdestruct(self.owner)

Contract Security Audit

Contract ABI

[{"name":"SomeoneSaidGovernance","inputs":[],"anonymous":false,"type":"event"},{"name":"NewGuess","inputs":[{"name":"lat","type":"int128","indexed":false},{"name":"long","type":"int128","indexed":false},{"name":"guesser","type":"address","indexed":false},{"name":"front","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"FoundDo","inputs":[{"name":"lat","type":"int128","indexed":false},{"name":"long","type":"int128","indexed":false},{"name":"kwonFinder","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"FoundSu","inputs":[{"name":"lat","type":"int128","indexed":false},{"name":"long","type":"int128","indexed":false},{"name":"zhuFinder","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"FoundKyle","inputs":[{"name":"lat","type":"int128","indexed":false},{"name":"long","type":"int128","indexed":false},{"name":"daviesFinder","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"payable","type":"function","name":"makeGuess","inputs":[{"name":"lat","type":"int128"},{"name":"long","type":"int128"},{"name":"frontend","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"doWinner","inputs":[{"name":"lat","type":"int128"},{"name":"long","type":"int128"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"suWinner","inputs":[{"name":"lat","type":"int128"},{"name":"long","type":"int128"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"kyleWinner","inputs":[{"name":"lat","type":"int128"},{"name":"long","type":"int128"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"playUsOutKeyboardCat","inputs":[{"name":"frontend","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"ended","inputs":[],"outputs":[{"name":"","type":"bool"}]}]

34610ad15733600055610ab661001a61000039610ab6610000f36003361161000c57610a9e565b60003560e01c631999c74a811861032c5760643610610aa45760043580600f0b8118610aa45760405260243580600f0b8118610aa4576060526044358060a01c610aa45760805267016345785d8a00003418156100c057601960a0527f596f752063616e206f6e6c792073656e6420302e31204554480000000000000060c05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b600260405160205260005260406000208060605160205260005260406000209050541561014457601860a0527f536f6d656f6e6520697320616c7265616479206d61796f72000000000000000060c05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa6604051121561017557600061017d565b605a60405113155b61020257602b60a0527f4c61746974756465206d75737420626520696e7465676572206265747765656e60c0527f202d393020616e6420393000000000000000000000000000000000000000000060e05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4c606051121561023357600061023b565b60b460605113155b6102c057602e60a0527f4c6f6e676974756465206d75737420626520696e74656765722062657477656560c0527f6e202d31383020616e642031383000000000000000000000000000000000000060e05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b6002604051602052600052604060002080606051602052600052604060002090503381556080516001820155507f53d5739da3b2a451ab0cc0ab0c72f5ed3d8325b8815e833e33454b37544c558f60405160a05260605160c0523360e05260805161010052608060a0a1005b34610aa45763528f02eb81186104d15760443610610aa45760043580600f0b8118610aa45760405260243580600f0b8118610aa4576060526000543318156103ef5760266080527f596f75206d757374206265206f776e657220746f20646566696e65207468652060a0527f77696e6e6572000000000000000000000000000000000000000000000000000060c0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546104725760196080527f6e6f2067756573732061742074686973206c61742f6c6f6e670000000000000060a0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546003557f816ac91f0655b615bc5c2ac87ab6696c45681742796765a402dd91a08c4e382360405160805260605160a05260035460c05260606080a1005b63a530ee6681186106715760443610610aa45760043580600f0b8118610aa45760405260243580600f0b8118610aa45760605260005433181561058f5760266080527f596f75206d757374206265206f776e657220746f20646566696e65207468652060a0527f77696e6e6572000000000000000000000000000000000000000000000000000060c0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546106125760196080527f6e6f2067756573732061742074686973206c61742f6c6f6e670000000000000060a0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546004557f58070a258915495ae387d700f149db4560fb83335adfb73315170601ecc6d72660405160805260605160a05260045460c05260606080a1005b6355dae2eb81186108115760443610610aa45760043580600f0b8118610aa45760405260243580600f0b8118610aa45760605260005433181561072f5760266080527f596f75206d757374206265206f776e657220746f20646566696e65207468652060a0527f77696e6e6572000000000000000000000000000000000000000000000000000060c0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546107b25760196080527f6e6f2067756573732061742074686973206c61742f6c6f6e670000000000000060a0526080506080518060a001601f826000031636823750506308c379a06040526020606052601f19601f6080510116604401605cfd5b600260405160205260005260406000208060605160205260005260406000209050546005557f027c3c18afad87e744a055442bc2f90c7ec434639636c039f2a739b1a66bb97d60405160805260605160a05260055460c05260606080a1005b63ad7061478118610a5e5760243610610aa4576004358060a01c610aa4576040526000543318156108bd5760246060527f596f75206d75737420626520746865206f776e657220626c616820626c6168206080527f626c61680000000000000000000000000000000000000000000000000000000060a05260605060605180608001601f826000031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b600554156108de57600454156108d75760035415156108e1565b60006108e1565b60005b6109425760176060527f77696e6e657273206d757374206265206465636964656400000000000000000060805260605060605180608001601f826000031636823750506308c379a06020526020604052601f19601f6060510116604401603cfd5b47600a81049050606052476006810490506080524760148104905060a0526000600060006000606051739d727911b54c455b0071a7b682fcf4bc444b55966000f115610aa45760006000600060006060517315322b546e31f5bfe144c4ae133a9db6f0059fe36000f115610aa457600060006000600060605173750ef1d7a0b4ab1c97b7a623d7917cceb5ea779c6000f115610aa457600060006000600060605173fa8e3920daf271dab92be9b87d9998ddd94fef086000f115610aa45760006000600060006080516003546000f115610aa45760006000600060006080516004546000f115610aa45760006000600060006080516005546000f115610aa457600060006000600060a0516040516000f115610aa457600054ff005b638da5cb5b8118610a7d5760043610610aa45760005460405260206040f35b6312fa6feb8118610a9c5760043610610aa45760015460405260206040f35b505b60006000fd5b600080fda165767970657283000307000b005b600080fd

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.