- Manage name registry on decentralized platform (ethereum)
- Buy/Sell via Bidding process for tamper-proof and best price mechanism
- Transfer funds (ether) via names (registered)
- Release names for a better price via bidding
- Checking the availability for a name
- Reserve a name if available, by sending a tx with amount of ether
- Release name by making it available (can be released only by their owners)
- Bid on names already taken (bids must be > original price)
- Owner of domain can change the ownership of the domain to the highest bidder
- Name can be used to send ether to its owner
- ethereum (ganache-cli)
- truffle
- nodeJS
- web3
- eslint
-
Bid DataModel:
- DataModel to store Bid Details for a given DNSName
- bidState in the model represents different states bid can stay in the workflow
- amount is the bidPrice made by Bidder
- owner is the address of the Bidder
contract DNSBid {
using DNSStates for DNSStates.BidStates;
DNSStates.BidStates public bidState;
bool public active;
uint public amount;
address public owner ;
}
-
Bid States:
- enum to hold the states that bid can go through in a Bid-Life cycle
enum BidStates {
BID_VOID,
BID_OPEN,
BID_ACCEPTED
}
-
Bid Registry:
-
A Container/Registry to hold all details/bids made for a given DNSName
-
Contains the storage for mappings:
- dnsBidMap : map to store all bids and respective bidder-addresses
- dnsBalanceMap : map to store the bidder-Address as key and bid-Price as Value
- bestBidder : Address of the Bidder whose bid was highest (indicative price)
//map to store all bids and respective bidder-address
mapping(address => DNSBid) public dnsBidMap;
// map Bidder to his/her value (address as key and ether as value)
mapping (address => uint) public dnsBalanceMap;
// winning bidder's address
address public bestBidder;
- Javascript Tests
- Solidity Tests (In-Progress)
lakshmikanth-MacBook-Pro:DNSDapp lakshmikanth$ truffle test
Using network 'test'.
Compiling ./contracts/BidRegistry.sol...
Compiling ./contracts/DNSBid.sol...
Compiling ./contracts/DNSDappMaster.sol...
Compiling ./contracts/DNSDataModel.sol...
Compiling ./contracts/DNSStates.sol...
Compiling ./contracts/DNSUtilLibrary.sol...
Contract: DNSDappMaster
✓ assert that non-existent name check returns false (50ms)
asserted that system cannot reserve an existing DNSName
✓ assert that system cannot Reserve on an existing and active DNSName (187ms)
✓ assert that system can Reserve a new DNSName (101ms)
✓ assert that system can Reserve a new DNSName and Transfer funds by using DNSName (117ms)
asserted that system cannot Transfer funds to non-existing DNSName
✓ assert that system cannot Transfer funds to non-existing DNSName
✓ assert that user can bid on a Name (132ms)
asserted that user cannot bid on a non-existing DNSName
✓ assert that user cannot bid on a non-existent Name
asserted that user cannot do zero-bidding on a non-existing DNSName
✓ assert that user cannot do zero-bidding on an existent DNSName
reject currentBidder as currentBidPrice is lesser than indicativePriceError: VM Exception while processing transaction: revert
✓ assert scenario of multiple users bidding on a DNSName (204ms)
reject currentBidder as currentBidPrice is lesser than indicativePriceError: VM Exception while processing transaction: revert
✓ assert the bid-Finalizing process (290ms)
✓ assert that dnsNameOwner can release ownership (99ms)
failed-attempt of release-ownership by fakeOwner: Kaiju
✓ assert that dnsNameOwner cannot be released by non-owning entity (63ms)
12 passing (1s)
- checkout source code
- navigate to source directory
- run npm install
- run truffle compile
- run truffle migrate
- run truffle test
Rinkeby Testnet (Infura) - In-progress
- UI on ReactJS
- End to End tests
- Use security mechanisms to avoid Re-entry and other DApp based attacks
- Assert for events emitted during reservation , new bid and bid-finalization process