Git Product home page Git Product logo

stakingtoken's People

Contributors

alcueca avatar obernardovieira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stakingtoken's Issues

Internal functions

I think the addStakeholder and removeStakeholder should be internal functions rather than public, as they are only created for the other fucntions in the contract to use them.

createStake, removeStake: Use contract address itself to store the staked balance

Would it be better to transfer the _stake amount to contract address itself instead of burn in createStake() ?
https://github.com/HQ20/StakingToken/blob/master/contracts/StakingToken.sol#L50
_burn subtracts the totalSupply and hence the suggestion.
Similarly for removeStake(), transfer back the amount from contract address to the msg.sender
Example:

    mapping(address => uint256) public staked;
    function stake(uint256 amount) external {
        require(balanceOf(msg.sender) >= amount, "staking amount is more than balance");
        transfer(address(this), amount);
        staked[msg.sender] += amount;
    }
    
    function unstake(uint256 amount) external {
        require(staked[msg.sender] >= amount, "staked amount is less than withdrawl amount");
        staked[msg.sender] -= amount;
        _transfer(address(this), msg.sender, amount);
    }

Question about the array handling.

I see that the array will be searched every time-
Is the position of the items inside the array different every time the contract get loaded into an client?
If the position is fixed then maybe a more processor time friendly logic could be implemented.

How to use it?

I've very low amount of coding knowledge. Can you help me by telling how to make stakeable erc20 token with remix. I don't find any options to add name, symbol, decimals & supply.

Update Staking for current token

I have 1 custom token on Kovan test net, but it just a simple smartcontact like "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol". And now I want to update Staking for my token. Can I do that without create 1 new token?

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.