Git Product home page Git Product logo

carbonstaking's Introduction

CarbonStakingScilla

Scilla codes for Carbon Token Staking Contract

carbon testnet: 0x3e1b442f12c57449464c7daa162803765606b81f
https://viewblock.io/zilliqa/address/0x3e1b442f12c57449464c7daa162803765606b81f?network=testnet
staking: https://devex.zilliqa.com/address/0x504f7f08c74130317b414e148c1e355ca2dc49fd?network=https://dev-api.zilliqa.com
future: https://devex.zilliqa.com/address/0x4ce0291f3d6f98dec8c6158820bdf425b41ebea0?network=https://dev-api.zilliqa.com

Do Raise any issues found via the issues section

TestCases done on new contract:

TransferStakeToNewContract

  • Only owner is able to call
  • Data cycleCount, cycleAmount, Stakers balance passed over

TransferUnstakeToNewContract

  • Only Owner is able to call
  • Data removeStaker, removeBlock RewardAll
  • Correct Amount given to all, in totalStaked increased and ownerAvailable decreased correctly

addStakeForOther

  • Overwrite if transition is called by same sender 2 times latest address is capture with amount
  • Transferred to contract wrong amount will reject the transaction
  • Transferred to contract the right amount pending is gone, correct amount is given to the address pending.
  • If whitelisting is in effect, the pending address also has to be whitelisted
  • if address already has staked, it will add on to their stake

withdrawal functions

  • withdrawStake working
  • RemoveStake working
  • instantWithdrawal

When removed totalStaked and totalUnstaked is adjusted accordingly totalStakers number is also accurate

Added pending to other addresses tried to send wrong amount (Failed) If correct amount sent, the stake is added in for the pending address

Remove pending if change of mind

rewardCycle seperated into new transition If rewardCycle count not met no rewards is given

Calculated rewardsAll given and deducted from owner correctly Calculated rewardCycle given and deducted from owner correctly

Tested whitelisting

carbonstaking's People

Contributors

0xjunwei avatar madmartian5 avatar

Watchers

 avatar

Forkers

okimoto-okipad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.