This is a very simple, smart contract which allows users to bid on contract ownership. It heavily leverage the Truffle Framework for development.
To use this project, it must be compiled and deployed. The smart contract can be deployed locally, on testnet, or mainnet.
- Truffle Framework
- Infura
- Ganache - optional
- Metamask - optional
- Parity UI - optional
The only real prerequesite is the Truffle Framework and an account on Infura. The others are not necessary but can make development/testing easier.
truffle compile
This will generate the contract json files in the /build directory. The json files are important because they contain the contract ABI and bytecode used to deploy the smart contract.
Before running the tests, start Ganache on your local machine.
truffle test
This project is setup to deploy to either a local blockchain instance (Ganache) or the Infura.io provided blockchain. Please update truffle.js with the proper credentials.
This contract has already been deployed to address 0x59729917Abf791f76642cdEeB55735C21Db45B45 on ropsten You can test the contract functionality by sending eth to this address. I'd recommend using Metamask to send eth. Please note, to become the new owner of the contract, more eth than the current price needs to be sen
You can also call the getOwner() function directly using web3 or any other Ethereum smart contract framework.
Also included is a simple node app that implements an event-listener and a REST API which calls the getOwner() function and getPastEvents() function.
To run the app:
npm install
Then you can run the app:
node app/server.js