Skip to content

bitcoin-portal/sol-farms

Repository files navigation

Process and Testing

The package can be run as a CLI for testing purposes.

💰 This command runs farm tests:

yarn test-farms

Test coverage

🧪 To generate test-coverage report simply run this command (without starting local chain)

yarn coverage

🧪 expected-latest test coverage results for farms:

-------------------|----------|----------|----------|----------|----------------|
File               |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-------------------|----------|----------|----------|----------|----------------|
 contracts/        |      100 |    95.24 |      100 |      100 |                |
  IERC20.sol       |      100 |      100 |      100 |      100 |                |
  SafeERC20.sol    |      100 |    66.67 |      100 |      100 |                |
  SimpleFarm.sol   |      100 |      100 |      100 |      100 |                |
  TestToken.sol    |      100 |      100 |      100 |      100 |                |
  TokenWrapper.sol |      100 |      100 |      100 |      100 |                |
-------------------|----------|----------|----------|----------|----------------|
All files          |      100 |    95.24 |      100 |      100 |                |
-------------------|----------|----------|----------|----------|----------------|

⛽ expected-latest gas consumption for farms:

·------------------------------------|---------------------------|-------------|------------------------------·
|        Solc version: 0.8.17        ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 100000000 gas  │
·····································|···························|·············|·······························
|  Methods                                                                                                    │
···············|·····················|·············|·············|·············|···············|···············
|  Contract    ·  Method             ·  Min        ·  Max        ·  Avg        ·  # calls      ·  eur (avg)   │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  approve            ·          -  ·          -  ·      46267  ·            3  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  changeManager      ·          -  ·          -  ·      30047  ·            2  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  claimOwnership     ·          -  ·          -  ·      29639  ·            2  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  claimReward        ·          -  ·          -  ·     104218  ·            1  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  exitFarm           ·          -  ·          -  ·     110999  ·            1  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  farmDeposit        ·      73560  ·     135760  ·     116896  ·           38  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  farmWithdraw       ·      66301  ·     106723  ·      79775  ·            3  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  proposeNewOwner    ·          -  ·          -  ·      47157  ·            3  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  recoverToken       ·          -  ·          -  ·      37424  ·            1  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  setRewardDuration  ·      31911  ·      31923  ·      31913  ·            5  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  setRewardRate      ·      91729  ·     140229  ·     135102  ·           18  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  transfer           ·          -  ·          -  ·      46578  ·            3  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  SimpleFarm  ·  transferFrom       ·          -  ·          -  ·      47834  ·            2  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  TestToken   ·  approve            ·      46194  ·      46218  ·      46217  ·           74  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  TestToken   ·  mint               ·          -  ·          -  ·      50821  ·            6  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  TestToken   ·  transfer           ·          -  ·          -  ·      51577  ·            3  ·           -  │
···············|·····················|·············|·············|·············|···············|···············
|  Deployments                       ·                                         ·  % of limit   ·              │
·····································|·············|·············|·············|···············|···············
|  SimpleFarm                        ·    1487042  ·    1487066  ·    1487064  ·        1.5 %  ·           -  │
·····································|·············|·············|·············|···············|···············
|  TestToken                         ·          -  ·          -  ·     627932  ·        0.6 %  ·           -  │
·------------------------------------|-------------|-------------|-------------|---------------|--------------·

SimpleFarm

🏭 expected creationCode hash:

0xfa923415d0153dc464f55b9793bb4a9c530c95f5808d935906d37f586c8f011c

About

Solidity Farming Contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published