Workers Auto Approve
Complete unit testing for Bullionix721.sol
Bullionix721.sol is finished but needs unit testing done to provide 100% coverage.
Some tests have already been added - but not actually tested. Meaning they probably don't work on truffle -test, until some tweaking is done.
Whats the function of Bullionix721.sol?
Bullionix721.sol is a smart contract, that allows for staking of an ERC20 token (DGX) to an NFT (ERC-721). This lets a user send DGX to Bullionix721.sol, and in return they get an NFT that tracks the amount staked to it. They can burn their NFT and get back their DGX whenever they want.
1. Create a new series - the owner of the contract can add new gold token series - such as a rare vitalik series, that requires 10 DGX (example numbers), or a common Crypto Series, that takes only 1 DGX.
2. Staking - Users will call the stake function after they have approved the contract to move the required DGX amount. Once calling stake, the DGX balance is sent to the smart contract and upon successful balance changes - the user is given an NFT that tracks the staked amount minus the fees.
3. User Withdrawals - users can burn their NFTs and get back their DGX that they staked (minus the DGX fees, and our fees).
4. IsOnline/Owner Withdrawal - Isonline is just a flag to toggle the functionality of the contract in case of a black swan event. Owner Withdrawal is for the owner of the contract to withdrawal the fees collected in the contract.
5. Fees - fees are set during create new series - there are two fees, the amount of DGX to stake, and the fee for bullionix. For example, the vitalik series that takes 10 DGX is the DGXCost variable, and the fee would be set by the owner as the amount Bullionix would profit from each NFT made. So in the vitalik example - it would be 10 DGXCost, Fee of 0.5 DGX. (dummy numbers).
DummyToken is deployed to act as DGX during the testing/testnet.
DGX contract has two fees that happen on any ERC20 transfer:
1. transfer fees - a small fee taken everytime DGX is moved. This means, we need to calculate the fee, and check that the amount sent to Bullionix is (properAmount - DGXtransferFee)
2. demurrage fees (storage fees) - not activated YET, but will be - so we need to check that the demurrage fee is properly calculated before staking and withdrawals. Demurrage is calculated via (rate/base) per day. You can see an example of the rate and base in the dummyToken.sol.
They have a kovan DGX contract on the testnet at: 0xaed4fc9663420ec8a6c892065bba49c935581dce
And the main contract for the mainnet is at:
_This, above ^, is just to let you understand the flow of the smart contract to help with testing._
Testing needs to be done to cover the entire scope of the smart contract, not just what was mentioned above.
Write Unit Testing to provide 100% coverage
Bullionx721.js is the test file.
Test need to cover the functionality of the Bullionix721.sol smart contract, as well as the other contracts used to mimic the DGX contract.
If you have any questions feel free to ask them or reach out on gitcoin.
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: