For more information on WFAIR token, check the official repository.
The WFAIRToken
is an ERC20 token that uses ERC1363 extentions.
The ERC20 implementation is provided by OpenZeppelin, and ERC1363 extensions are by https://github.com/vittominacori/erc1363-payable-token.
The extensions are intended for the token to be used within the Wallfair ecosystem, interacting with PLP, Staking, DAO without the need of an additional approve
transaction.
Distamarkets
implement many of the functionalities as described by the Wallfair whitepaper.
The contract allows the following:
- Create markets
- Place bets (add stake in outcome) in markets
- Remove bets from markets early
- Cancel markets and refunds
- Resolution of markets and rewards distribution
- Dispute resolution
Markets can be in the following states:
- Users can add stakes in outcomes ✔
- Users can remove stakes from outcomes (with fees) ✔
- Creator OR oracle can cancel the market ✔
Ended is a state of an Open contract whose closing time has passed.
- Oracle can resolve the market and provide an outcome ✔
- Oracle can cancel the market ✔
- Before the specified dispute time has passed, users can create a dispute to the resolution ✔
- Oracle can close the market ✔
- Oracle can cancel the market ✔
- Users can withdraw winnings ✔
- Creator can withdraw the collected fees ✔
- Users can withdraw their stakes with collected fees ✔
Clone the repository:
git clone https://github.com/gmussi/Distamarkets.git
Ensure you have node.js and npm installed. You must be using npm version >= 7.
Then install the required packages for the Hardhat toolchain:
npm install
Next, try compiling the contracts to see if it has all worked:
npm run compile
We use the hardhat waffle
plugin to write tests. Tests can be run using:
npm run test
We use solidity-coverage with npm run coverage
.
We use the hardhat solhint
plugin to check code styling. It can be run with:
npm run linter
Alternatively, to guarantee code is in good condition, we use prettify plugin with:
npx prettier --write 'contracts/**/*.sol'
TODO
To learn more about the utility of the token, read the litepaper.
© 2021 Wallfair.