Giter Site home page Giter Site logo

hashport-contracts's People

Contributors

coiling-dragon avatar daniel-k-ivanov avatar failfmi avatar holymir avatar julian-bcw avatar rokn avatar trayanm avatar vectorman1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hashport-contracts's Issues

Add Fee Policy contracts

  1. Define IFeePolicy interface contract which will abstract all different fee policies that will be implemented.
    • Method feeAmount(uint256 _amount) returns (uint256)
  2. Implement this interface for
    • PercentageFee (% of overall transaction amount)
    • FlatFee (flat token amount fee)

These contracts will be deployed on a per-user and per-asset basis which will have a specific service fee policy for porting usage. Once deployed, should be updated in the LibFeeCalculator user -> fee policy mapping.

The contracts' owner will be the multi-sig gnosis wallet governing the router contracts themselves.

User Stories

verify Avalanche Router on mainnet

Please verify the avalanche Router address:ย  0xd8df34A071179fe8CEF910Ae0B43cdE49D611B49 on mainnet. You will need to checkout to the last commit before the deployment c26ee04 and pass the same order of the facets as in the router constructor.

Update LibFeeCalculator to check for user-specific fee policies

Relevant contract

  1. Add a mapping to FeeCalculator for user address -> token address -> fee policy:
    • mapping(address => mapping(address => IFeePolicy)) feePolicies
  2. Add functions to set and remove fee policies from the mapping
    • setFeePolicy(address _user, address _token, IFeePolicy _policy)
    • deleteFeePolicy(address _user, address _token, IFeePolicy _policy)
  3. In distributeRewards(address _token, uint256 _amount) before L85 check the mapping for a set fee policy for the msg.sender. If such exists, call the policy feeAmount() to get the service fee.

User Stories

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.