Sales

Loading...
# Initialization
init:
	# *** An Ethereum smart contract to sell 100 beanie babies for "5000 by January"
	# First, store buyer's ethereum address:
	contract.storage["BUYER"] = 
	# Then, store seller's ethereum address:
	contract.storage["SELLER"] = 
	# December 31, 2014 is 1419984000 in "computer time"
	contract.storage["DEADLINE"] = 1419984000
# Code
code:
	# If the agreed amount is received on time...
	if (contract.balance >= 5000*10^18 and block.timestamp <= contract.storage["DEADLINE"]):
	    # ... then designate the buyer as the new owner and pay the seller
	    contract.storage["OWNER"] = contract.storage["BUYER"]
	    send(contract.storage["SELLER"], contract.balance, (tx.gas - 100))

Serpent contract for Ethereum

My Serpent code description.

Preferences

Note: Your changes won't be saved, because not Logged-in.

Create your own Contract