Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OlympusDAO/olympus-contracts
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: Version-1.1
Choose a base ref
...
head repository: CRE8RDAO/gm-contracts
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: Version-1.1
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 66,075 additions and 155 deletions.
  1. +4 −1 .gitignore
  2. +24 −14 README.md
  3. +1 −0 abis/IUniswapV2Factory.json
  4. +1 −0 abis/IUniswapV2Router02.json
  5. +22 −22 contracts/BondDepository.sol
  6. +296 −0 contracts/BrickFarming.sol
  7. +9 −9 contracts/OlympusERC20.sol
  8. +14 −14 contracts/Staking.sol
  9. +37 −37 contracts/StakingDistributor.sol
  10. +16 −20 contracts/Treasury.sol
  11. +17 −0 contracts/mocks/MockBrickToken.sol
  12. +13 −0 contracts/mocks/MockStakedToken.sol
  13. +68 −0 contracts/mocks/WrappedToken.sol
  14. +11 −11 contracts/sOlympusERC20.sol
  15. +23 −23 contracts/wETHBondDepository.sol
  16. +3 −3 contracts/wOHM.sol
  17. +16 −0 deploy/001_deploy_brick.js
  18. +25 −0 deploy/002_deploy_mock_frax.js
  19. +18 −0 deploy/003_deploy_mock_wrapped_token.js
  20. +14 −0 deploy/004_deploy_bonding_calculator.js
  21. +28 −0 deploy/005_deploy_treasury.js
  22. +29 −0 deploy/006_deploy_staking_distributor.js
  23. +14 −0 deploy/007_deploy_sbrick.js
  24. +36 −0 deploy/008_deploy_staking.js
  25. +17 −0 deploy/009_deploy_staking_warmup.js
  26. +17 −0 deploy/010_deploy_staking_helper.js
  27. +35 −0 deploy/011_deploy_frax_bond_depository.js
  28. +34 −0 deploy/012_deploy_wrapped_token_bond_depository.js
  29. +26 −0 deploy/013_deploy_wsbrick.js
  30. +13 −0 deploy/014_deploy_redeem_helper.js
  31. +1 −0 deployments/base/.chainId
  32. +1,270 −0 deployments/base/BrickFraxBondDepository.json
  33. +546 −0 deployments/base/Distributor.json
  34. +1,270 −0 deployments/base/FraxBondDepository.json
  35. +148 −0 deployments/base/OlympusBondingCalculator.json
  36. +746 −0 deployments/base/OlympusERC20Token.json
  37. +744 −0 deployments/base/OlympusStaking.json
  38. +1,683 −0 deployments/base/OlympusTreasury.json
  39. +234 −0 deployments/base/RedeemHelper.json
  40. +99 −0 deployments/base/StakingHelper.json
  41. +104 −0 deployments/base/StakingWarmup.json
  42. +1,254 −0 deployments/base/WrappedTokenBondDepository.json
  43. +1,093 −0 deployments/base/sOlympus.json
  44. +125 −0 deployments/base/solcInputs/4269b51490de84488c0346a55eaf82e8.json
  45. +125 −0 deployments/base/solcInputs/eb7c7ea3568cc475050eef7fd79d8467.json
  46. +686 −0 deployments/base/wOHM.json
  47. +1 −0 deployments/ftmTestnet/.chainId
  48. +545 −0 deployments/ftmTestnet/Distributor.json
  49. +738 −0 deployments/ftmTestnet/FRAX.json
  50. +1,269 −0 deployments/ftmTestnet/FraxBondDepository.json
  51. +147 −0 deployments/ftmTestnet/OlympusBondingCalculator.json
  52. +731 −0 deployments/ftmTestnet/OlympusERC20Token.json
  53. +743 −0 deployments/ftmTestnet/OlympusStaking.json
  54. +1,682 −0 deployments/ftmTestnet/OlympusTreasury.json
  55. +233 −0 deployments/ftmTestnet/RedeemHelper.json
  56. +98 −0 deployments/ftmTestnet/StakingHelper.json
  57. +103 −0 deployments/ftmTestnet/StakingWarmup.json
  58. +1,253 −0 deployments/ftmTestnet/WftmBondDepository.json
  59. +560 −0 deployments/ftmTestnet/WrappedToken.json
  60. +1,078 −0 deployments/ftmTestnet/sOlympus.json
  61. +38 −0 deployments/ftmTestnet/solcInputs/41405b29ec3f34eedae24ae3c052596f.json
  62. +38 −0 deployments/ftmTestnet/solcInputs/62f72713a068c51a22e699b7352fa7db.json
  63. +53 −0 deployments/ftmTestnet/solcInputs/77788eae31d169a831f4a6df224e3de9.json
  64. +59 −0 deployments/ftmTestnet/solcInputs/778fd7df05b9b5e245a90ea93cf9b329.json
  65. +38 −0 deployments/ftmTestnet/solcInputs/80205d7caa85cf7d901b88f836b16309.json
  66. +83 −0 deployments/ftmTestnet/solcInputs/8d3774b312edc15e04c44a56a82de7d8.json
  67. +35 −0 deployments/ftmTestnet/solcInputs/d0f6f5ddb1e2301823073d2aeed57f8f.json
  68. +35 −0 deployments/ftmTestnet/solcInputs/eadcd4626d6a4201a21a3b7bdbfda2f8.json
  69. +673 −0 deployments/ftmTestnet/wOHM.json
  70. +1 −0 deployments/rinkeby/.chainId
  71. +1,269 −0 deployments/rinkeby/BrickFraxBondDepository.json
  72. +545 −0 deployments/rinkeby/Distributor.json
  73. +738 −0 deployments/rinkeby/FRAX.json
  74. +1,269 −0 deployments/rinkeby/FraxBondDepository.json
  75. +147 −0 deployments/rinkeby/OlympusBondingCalculator.json
  76. +745 −0 deployments/rinkeby/OlympusERC20Token.json
  77. +743 −0 deployments/rinkeby/OlympusStaking.json
  78. +1,682 −0 deployments/rinkeby/OlympusTreasury.json
  79. +233 −0 deployments/rinkeby/RedeemHelper.json
  80. +98 −0 deployments/rinkeby/StakingHelper.json
  81. +103 −0 deployments/rinkeby/StakingWarmup.json
  82. +560 −0 deployments/rinkeby/WrappedToken.json
  83. +1,253 −0 deployments/rinkeby/WrappedTokenBondDepository.json
  84. +1,092 −0 deployments/rinkeby/sOlympus.json
  85. +53 −0 deployments/rinkeby/solcInputs/77788eae31d169a831f4a6df224e3de9.json
  86. +59 −0 deployments/rinkeby/solcInputs/778fd7df05b9b5e245a90ea93cf9b329.json
  87. +38 −0 deployments/rinkeby/solcInputs/80205d7caa85cf7d901b88f836b16309.json
  88. +83 −0 deployments/rinkeby/solcInputs/8d3774b312edc15e04c44a56a82de7d8.json
  89. +35 −0 deployments/rinkeby/solcInputs/bbf3f95bcfbd20e9e9f7857af806cde4.json
  90. +35 −0 deployments/rinkeby/solcInputs/c9b246e9781a79119b50bb31bf7fa5c6.json
  91. +35 −0 deployments/rinkeby/solcInputs/d0f6f5ddb1e2301823073d2aeed57f8f.json
  92. +38 −0 deployments/rinkeby/solcInputs/fb3b81c61761bcfb33ca99488ac60a1b.json
  93. +685 −0 deployments/rinkeby/wOHM.json
  94. +152 −0 hardhat.config.js
  95. +21,768 −0 package-lock.json
  96. +4 −1 package.json
  97. +32 −0 scripts/bonding_test.js
  98. +50 −0 scripts/brick_frax_pair_bond_deployment/NOT_NEEDED_deploy_brick_frax_pair.js
  99. +66 −0 scripts/brick_frax_pair_bond_deployment/step_1_add_liquidity_to_brick_frax_pair.js
  100. +46 −0 scripts/brick_frax_pair_bond_deployment/step_2_deploy_brick_frax_bond_depository.js
  101. +78 −0 ...rax_pair_bond_deployment/step_3_whitelist_brick_frax_pair_depository_and_initialize_bond_terms.js
  102. +47 −0 scripts/brick_frax_pair_bond_deployment/step_4_toggle_brick_frax_pair_depository.js
  103. +18 −0 scripts/brick_frax_pair_bond_deployment/step_5_add_bond_to_redeem_helper.js
  104. +53 −0 scripts/create_brick_wrapped_token_pair.js
  105. +13 −0 scripts/etherscan_verify.sh
  106. +32 −0 scripts/initial_mint_brick_for_airdrop.js
  107. +31 −0 scripts/liquidity_bonding_test.js
  108. 0 scripts/{ → original_ohm_scripts}/deployAll.js
  109. 0 scripts/{ → original_ohm_scripts}/deployCVXBondDepo.js
  110. +32 −0 scripts/post_deployment/step_1.js
  111. +71 −0 scripts/post_deployment/step_10.js
  112. +20 −0 scripts/post_deployment/step_11.js
  113. +22 −0 scripts/post_deployment/step_2.js
  114. +29 −0 scripts/post_deployment/step_3.js
  115. +23 −0 scripts/post_deployment/step_4.js
  116. +23 −0 scripts/post_deployment/step_5.js
  117. +29 −0 scripts/post_deployment/step_6.js
  118. +27 −0 scripts/post_deployment/step_7.js
  119. +65 −0 scripts/post_deployment/step_8.js
  120. +66 −0 scripts/post_deployment/step_9.js
  121. +30 −0 scripts/staking_test.js
  122. +55 −0 scripts/transfer_ownership_to_multisig.js
  123. BIN test/.DS_Store
  124. +379 −0 test/BrickFarming-Unit.test.waffle.chai.ethers.js
  125. +43 −0 test/utils/constants.js
  126. +63 −0 test/utils/helpers.js
  127. +21 −0 test/utils/timeUtils.js
  128. +29 −0 test/utils/unitUtils.js
  129. +22 −0 utils/getTokenAddress.js
  130. +9,855 −0 yarn.lock
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules/
artifacts/
cache/
cache/
deployments/localhost
.env
.DS_Store
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ω Olympus Smart Contracts
# 🧱 GOD MODE Smart Contracts


## 🔧 Setting up Local Development
@@ -18,31 +18,41 @@ Local Setup Steps:
## 🤨 How it all works
![High Level Contract Interactions](./docs/box-diagram.png)

## Mainnet Contracts & Addresses
## FTM Testnet Contracts & Addresses

- BRICK 0x80FAcC2c14E6F1B31A952C43264b333C2788f30f
- Mock FRAX 0x9e008Cc93b4D2179dB48Fe5A0fed6B484aFf1739
- Mock WFTM 0x0Ae825CD631d5b59D56ACc635f1599ebb3390A6d
- BondingCalculator 0x17FC72CA16208b085613B0CA120914c8D546A764
- Treasury 0xe8e51612b1606c410E1240b80A5b3F2046ce7006
- Distributor 0xf0424efD7295e0b81f143cA23eFBA3b476ed9C1e
- sBRICK 0x9f6fBD3ac94BA9c823c43F2Ae0dcA80A4783e3b5
- Staking 0x6137c9684283D515DE179cb897a5d0345C61488F
- StakingWarmup 0xB8408Fc5f5aE1980a6af4CaA6118E98F7c328A5d
- StakingHelper 0x2663a2E5f4DF96b79377DA6B15e448b012838Cb8
- FraxBondDepository 0x38E4560A1DB2DAe89F78F98b308eE6F890b27712
- WftmBondDepository 0x1e0AD0F8DDFF84FDc938373E9aa66b8d994ea066

|Contract | Addresss | Notes |
|:-------------:|:-------------------------------------------------------------------------------------------------------------------:|-------|
|OHM |[0x383518188c0c6d7730d91b2c03a03c837814a899](https://etherscan.io/address/0x383518188c0c6d7730d91b2c03a03c837814a899)| Main Token Contract|
|sOHM |[0x31932e6e45012476ba3a3a4953cba62aee77fbbe](https://etherscan.io/address/0x31932e6e45012476ba3a3a4953cba62aee77fbbe)| Staked Ohm|
|Treasury |[0x31F8Cc382c9898b273eff4e0b7626a6987C846E8](https://etherscan.io/address/0x31F8Cc382c9898b273eff4e0b7626a6987C846E8)| Olympus Treasury holds all the assets |
|OlympusStaking |[0xfd31c7d00ca47653c6ce64af53c1571f9c36566a](https://etherscan.io/address/0xfd31c7d00ca47653c6ce64af53c1571f9c36566a)| Main Staking contract responsible for calling rebases every 2200 blocks|
|StakingHelper |[0xc8c436271f9a6f10a5b80c8b8ed7d0e8f37a612d](https://etherscan.io/address/0xc8c436271f9a6f10a5b80c8b8ed7d0e8f37a612d)| Helper Contract to Stake with 0 warmup |
|Aave Allocator |[0x0e1177e47151Be72e5992E0975000E73Ab5fd9D4](https://etherscan.io/address/0x0e1177e47151Be72e5992E0975000E73Ab5fd9D4)| Sends DAI from the treasury to Aave (via deposit) in exchange for aDAI and holds it. See [Allocator Guide](#allocator-guide)|
|Convex Allocator |[0x3dF5A355457dB3A4B5C744B8623A7721BF56dF78](https://etherscan.io/address/0x3dF5A355457dB3A4B5C744B8623A7721BF56dF78)| Sends FRAX from the treasury to Convex and accumulates trading fees, CRV and CVX. See [Allocator Guide](#allocator-guide)|
|Onsen Allocator |[0x0316508a1b5abf1CAe42912Dc2C8B9774b682fFC](https://etherscan.io/address/0x0316508a1b5abf1CAe42912Dc2C8B9774b682fFC)| Sends OHM-DAI SLP from the treasury to the Sushi Onsen pool, accumulating SUSHI and xSUSHI. See [Allocator Guide](#allocator-guide)|
|DAO |[0x245cc372C84B3645Bf0Ffe6538620B04a217988B](https://etherscan.io/address/0x245cc372C84B3645Bf0Ffe6538620B04a217988B)|Storage Wallet for DAO under MS |
|Staking Warm Up|[0x2882A5CD82AC49e06620382660f5ed932607c5f1](https://etherscan.io/address/0x2882A5CD82AC49e06620382660f5ed932607c5f1)| Instructs the Staking contract when a user can claim sOHM |
|fBRICK |[0x80FAcC2c14E6F1B31A952C43264b333C2788f30f](https://testnet.ftmscan.com/address/0x80FAcC2c14E6F1B31A952C43264b333C2788f30f)| Main Token Contract|
|spBRICK |[0x9f6fBD3ac94BA9c823c43F2Ae0dcA80A4783e3b5](https://testnet.ftmscan.com/address/0x9f6fBD3ac94BA9c823c43F2Ae0dcA80A4783e3b5)| Staked fOHM|
|Treasury |[0xe8e51612b1606c410E1240b80A5b3F2046ce7006](https://testnet.ftmscan.com/address/0xe8e51612b1606c410E1240b80A5b3F2046ce7006)| Olympus Treasury holds all the assets |
|OlympusStaking |[0x6137c9684283D515DE179cb897a5d0345C61488F](https://etherscan.io/address/0x6137c9684283D515DE179cb897a5d0345C61488F)| Main Staking contract responsible for calling rebases every 2200 blocks|
|StakingHelper |[0x2663a2E5f4DF96b79377DA6B15e448b012838Cb8](https://etherscan.io/address/0x2663a2E5f4DF96b79377DA6B15e448b012838Cb8)| Helper Contract to Stake with 0 warmup |
|DAO |[](https://etherscan.io/address/)|Storage Wallet for DAO under MS |
|Staking Warm Up|[0xB8408Fc5f5aE1980a6af4CaA6118E98F7c328A5d](https://etherscan.io/address/0x2882A5CD82AC49e06620382660f5ed932607c5f1)| Instructs the Staking contract when a user can claim sOHM |


**Bonds**
- **_TODO_**: What are the requirements for creating a Bond Contract?
All LP bonds use the Bonding Calculator contract which is used to compute RFV.

|Contract | Addresss | Notes |
|Contract | Addresses | Notes |
|:-------------:|:-------------------------------------------------------------------------------------------------------------------:|-------|
|Bond Calculator|[0xcaaA6a2d4B26067a391E7B7D65C16bb2d5FA571A](https://etherscan.io/address/0xcaaA6a2d4B26067a391E7B7D65C16bb2d5FA571A)| |
|DAI bond|[0x575409F8d77c12B05feD8B455815f0e54797381c](https://etherscan.io/address/0x575409F8d77c12B05feD8B455815f0e54797381c)| Main bond managing serve mechanics for OHM/DAI|
|DAI/OHM SLP Bond|[0x956c43998316b6a2F21f89a1539f73fB5B78c151](https://etherscan.io/address/0x956c43998316b6a2F21f89a1539f73fB5B78c151)| Manages mechhanism for thhe protocol to buy baack its own liquidity from the pair. |
|DAI/OHM SLP Bond|[0x956c43998316b6a2F21f89a1539f73fB5B78c151](https://etherscan.io/address/0x956c43998316b6a2F21f89a1539f73fB5B78c151)| Manages mechanism for the protocol to buy back its own liquidity from the pair. |
|FRAX Bond|[0x8510c8c2B6891E04864fa196693D44E6B6ec2514](https://etherscan.io/address/0x8510c8c2B6891E04864fa196693D44E6B6ec2514)|Similar to DAI bond but using FRAX|
|FRAX/OHM SLP Bond|[0xc20CffF07076858a7e642E396180EC390E5A02f7](https://etherscan.io/address/0xc20CffF07076858a7e642E396180EC390E5A02f7)| Similar to DAI/OHM but using FRAX |

1 change: 1 addition & 0 deletions abis/IUniswapV2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"},{"internalType":"bool","name":"_locked","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"constant":true,"inputs":[],"name":"INIT_CODE_PAIR_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"feeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feeToSetter","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeTo","type":"address"}],"name":"setFeeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"}],"name":"setFeeToSetter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_locked","type":"bool"}],"name":"setLocked","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Loading