Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rc07 #29

Merged
merged 20 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,31 @@ These operations are executed by the Low Sec TechOps multisig with a Low Sec Tim
```
*Example:* `brownie run scripts/ebtc_governance.py priceFeed_set_fallback_caller 0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1`

8. **Set Fee BPS for ActivePool Contract**
8. **Set Collateral Feed Source for PriceFeed Contract**
```bash
brownie run scripts/ebtc_governance.py priceFeed_set_collateral_feed_source <enable_dynamic_feed>
```
*Example:* `brownie run scripts/ebtc_governance.py priceFeed_set_collateral_feed_source True`

9. **Batch the Collateral Feed Source for PriceFeed Contract and Redemption Fee Floor for the CDPManager Contract**
```bash
brownie run scripts/ebtc_governance.py batch_collateral_feed_source_and_redemption_fee_floor <enable_dynamic_feed> <new_fee_floor>
```
*Example:* `brownie run scripts/ebtc_governance.py batch_collateral_feed_source_and_redemption_fee_floor True 100000`

10. **Set Fee BPS for ActivePool Contract**
```bash
brownie run scripts/ebtc_governance.py activePool_set_fee_bps <value>
```
*Example:* `brownie run scripts/ebtc_governance.py activePool_set_fee_bps 3000`

9. **Set Fee BPS for BorrowerOperations Contract**
11. **Set Fee BPS for BorrowerOperations Contract**
```bash
brownie run scripts/ebtc_governance.py borrowerOperations_set_fee_bps <value>
```
*Example:* `brownie run scripts/ebtc_governance.py borrowerOperations_set_fee_bps 3000`

10. **Set Secondary Oracle for EBTCFeed Contract**
12. **Set Secondary Oracle for EBTCFeed Contract**
```bash
brownie run scripts/ebtc_governance.py ebtcFeed_set_secondary_oracle <address>
```
Expand Down
208 changes: 194 additions & 14 deletions great_ape_safe/ape_api/ebtc.py

Large diffs are not rendered by default.

79 changes: 55 additions & 24 deletions helpers/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,40 @@
import json

ADDRESSES_ETH = {
"assets": {
"wbtc": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"ebtc": "0x0000000000000000000000000000000000000000",
"liq": "0xD82fd4D6D62f89A1E50b1db69AD19932314aa408",
"ebtc": {
"collateral": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"authority": "0x93d4f82903B87E94796Ec3665efa5f67F2072c6e",
"liquidation_library": "0x55262e1128FafD9Bb0B0fD59A8998c13299c4AD4",
"cdp_manager": "0x3c672ee8e13Cde7617923658138B111e157C8997",
"borrower_operations": "0x99c4ea5d7aDF5d115c85AEEDD98Bd26DdBa714Cb",
"ebtc_token": "0xead18fD27CAa1CFf909B5f2BD26ac9a46a6Ab1b5",
"price_feed": "0x12A7897Cb1a2Ce8A2F1Bf221c1E6ef9bb11ECA8D",
"ebtc_feed": "0x4039ca03Ce49021655c9B7C52Ab817d42DB7325e",
"active_pool": "0x1e3Bf0965dca89Cd057d63c0cD65A37Acf920590",
"coll_surplus_pool": "0x596EfaF17dFb3fd2CAE7543Ffa399F6e31658E4D",
"sorted_cdps": "0x6cb99cF839c5AD3C24431c85da5Fdb7c7ab66d97",
"hint_helpers": "0xE5A25E39A95750326322175249699eC5Cd66919F",
"fee_recipient": "0x522ef088d94BD2125eC47F0967bf5B4E79Af4ed8",
"multi_cdp_getter": "0x4e638aA073cAB30Ef2Ba63AA38ca5795Ada48E82",
"ebtc_deployer": "0xA93A9CBBD47AA7B57853D460f442E2de2FB1dA4D",
"highsec_timelock": "0xaDDeE229Bd103bb5B10C3CdB595A01c425dd3264",
"lowsec_timelock": "0xE2F2D9e226e5236BeC4531FcBf1A22A7a2bD0602",
},
"ebtc_wallets": {
"security_multisig": "0xB3d3B6482fb50C82aa042A710775c72dfa23F7B4",
"techops_multisig": "0x690C74AF48BE029e763E61b4aDeB10E06119D3ba",
"fee_recipient_multisig": "0x2CEB95D4A67Bf771f1165659Df3D11D8871E906f",
},
"badger_wallets": {
"treasury_ops_multisig": "0x042B32Ac6b453485e357938bdC38e0340d4b9276",
"treasury_vault_multisig": "0xD0A7A8B98957b9CD3cFB9c0425AbE44551158e9e",
},
"ebtc_wallets": {"placeholder": "0x0000000000000000000000000000000000000000"},
"assets": {
"wbtc": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"ebtc": "0xead18fD27CAa1CFf909B5f2BD26ac9a46a6Ab1b5",
"liq": "0xD82fd4D6D62f89A1E50b1db69AD19932314aa408",
"steth": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
},
"uniswap": {
"factoryV3": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
"NonfungiblePositionManager": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
Expand All @@ -27,38 +51,45 @@
"vault_relayer": "0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",
"settlement": "0x9008D19f58AAbD9eD0D60971565AA8510560ab41",
},
"chainlink": {
"collEthCLFeed": "0x86392dC19c0b719886221c78AB11eb8Cf5c52812",
"btcUsdCLFeed": "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c",
"ethUsdCLFeed": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
"chainlinkAdapter": "0x791a60EfEB402187852BdCDeC6Df3BEDd429fd81",
},
}

ADDRESSES_SEPOLIA = {
"ebtc": {
"collateral": "0x97BA9AA7B7DC74f7a74864A62c4fF93b2b22f015",
"authority": "0xb80142C74353066519a47119CE589ef0059EC169",
"liquidation_library": "0x8C4f04c7164fB3847D4dFdD0470707a74DB72215",
"cdp_manager": "0x4819558026d1bAe3ab4B6DE203a0483E8F23E047",
"borrower_operations": "0x3CABDD1dF8aDdd87DA26a24ccD292f64b6065f2B",
"ebtc_token": "0x0b3e07D082F07d6a8Dba3a6f6aCf32ae1ed16Ea4",
"price_feed": "0xD91c9CF0499ba9A6Eee7BED92c9F938C5fD4eD69",
"ebtc_feed": "0x5DbF3c1417BE8E0DF3e167E7054823B018EE5fdD",
"active_pool": "0x2A83d2b80D908A03032ddb274ED854c17815f60A",
"coll_surplus_pool": "0xb7a0f6e823ba9f4b80003aF37af71bAE04868eBb",
"sorted_cdps": "0x9637Aa7b8fEAa6Ae3481f7cC08EAe523ac032D61",
"hint_helpers": "0xfc6dc2C90bF01c7B7bfe7F4D14C77F155613C54b",
"fee_recipient": "0x37A7E626dac6d6253a6423674CaA41204661cAcd",
"multi_cdp_getter": "0x3Bf95b56488Dfb33B23c6CcB80F1589d87530A37",
"ebtc_deployer": "0xC0BB8cB46778777308C51b863e6200A48BCDaEC5",
"highsec_timelock": "0x0F7eBa761D85351aa94F47AF66B16409b673144d",
"lowsec_timelock": "0x981EF454d1433C664C09F1b8d73B0381D13ac7BD",
"authority": "0x85A074FF5adDf47fD66c94C780E7596922B3d1D9",
"liquidation_library": "0x64B22874Bdc9F2e98C11b1bd6BA5527cf42Ef5c9",
"cdp_manager": "0x39D6613ABEDd78a0b8edEEfE62cDEc85FCbe08c0",
"borrower_operations": "0x3D6697c8Cfcc36b68a3077d0a94385B8904B1299",
"ebtc_token": "0xeA2D83AA5e7da0668AdbddADAAc28e51318DDd86",
"price_feed": "0xd2Bdc5Acb219ECeEE3578DA86774BBE4dd85665E",
"ebtc_feed": "0x14BBa0A866f49D1ef33096557e661bE20BeBADA0",
"active_pool": "0x8EbA6a17Fcd480A96a87308C560170206186D3EA",
"coll_surplus_pool": "0x6a6Ee2146f851fA745016B9e5592379f775b4ff3",
"sorted_cdps": "0x0ADF592E25ba775b89cA37e0Fc01420CA96563C8",
"hint_helpers": "0x6AAB2e5f4bA902890197e5F60EB1aA420F2c079F",
"fee_recipient": "0xed072C4DaA8c3068eAda19B17ec63172975Abe7e",
"multi_cdp_getter": "0xBdd15a507945557ef039c847FB70d31f65522150",
"ebtc_deployer": "0x21D4211d6125B40bA6049308204B091A8efE3452",
"highsec_timelock": "0x0393846e97ab5Ec1DC8CB7A59Ee8505F72A6aEEb",
"lowsec_timelock": "0xaADf07C98E2420E4d995Ba41Db53399648f50076",
"test_contracts": {
"test_price_feed": "0xD91c9CF0499ba9A6Eee7BED92c9F938C5fD4eD69"
"test_price_feed": "0xD91c9CF0499ba9A6Eee7BED92c9F938C5fD4eD69",
"mock_fallback_caller": "0x9283D34b5559218C3E36a1fc53c78356D8DFEa30",
},
},
"ebtc_wallets": {
"security_multisig": "0xC8A7768D2a9EE15437c981a7130268622083c2BD",
"techops_multisig": "0x664F43229dDa9fdEE00e723753f88f3Ba81967F6",
"fee_recipient_multisig": "0x5C1246E0b464060919301273781a266Ac119A0Bb",
},
"tokens": {
"ebtc": "0x0b3e07D082F07d6a8Dba3a6f6aCf32ae1ed16Ea4",
"assets": {
"ebtc": "0xeA2D83AA5e7da0668AdbddADAAc28e51318DDd86",
"steth": "0x97BA9AA7B7DC74f7a74864A62c4fF93b2b22f015",
"wbtc": "0x84beA728aFb989756B4AF86600C0a95919035849",
},
Expand Down
10 changes: 10 additions & 0 deletions helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@

def encode_signature(signature: str) -> str:
return web3.keccak(text=signature).hex()[0:10]


# Assert approximate integer
def approx(actual, expected, percentage_threshold):
print(actual, expected, percentage_threshold)
diff = int(abs(actual - expected))
# 0 diff should automtically be a match
if diff == 0:
return True
return diff < (actual * percentage_threshold // 100)
Loading
Loading