-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test in prod rate provider; arbitrum
- Loading branch information
1 parent
6a52a66
commit 095d062
Showing
2 changed files
with
128 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# flake8: noqa | ||
|
||
import os | ||
import sys | ||
|
||
import boa | ||
import yaml | ||
from boa.network import NetworkEnv | ||
from eth.constants import ZERO_ADDRESS | ||
from eth_account import Account | ||
from rich import console as rich_console | ||
|
||
sys.path.append("./") | ||
from scripts.deploy_addressprovider_and_setup import fetch_url | ||
from scripts.legacy_base_pools import base_pools as BASE_POOLS | ||
from scripts.utils.constants import FIDDY_DEPLOYER | ||
|
||
console = rich_console.Console() | ||
|
||
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" | ||
ADDRESS_PROVIDER = ( | ||
"0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98" # gets replaced for zksync | ||
) | ||
|
||
|
||
def main(network, fork, url): | ||
if network == "zksync": | ||
if not fork: | ||
boa_zksync.set_zksync_env(url) | ||
console.log("Prodmode on zksync Era ...") | ||
else: | ||
boa_zksync.set_zksync_fork(url) | ||
console.log("Forkmode on zksync Era ...") | ||
|
||
boa.env.set_eoa(Account.from_key(os.environ["FIDDYDEPLOYER"])) | ||
|
||
else: | ||
if fork: | ||
boa.env.fork(url) | ||
console.log("Forkmode ...") | ||
boa.env.eoa = FIDDY_DEPLOYER # set eoa address here | ||
else: | ||
console.log("Prodmode ...") | ||
boa.set_env(NetworkEnv(url)) | ||
boa.env.add_account(Account.from_key(os.environ["FIDDYDEPLOYER"])) | ||
|
||
address_provider = boa.load_partial("contracts/AddressProviderNG.vy").at( | ||
ADDRESS_PROVIDER | ||
) | ||
console.log("Deploying rate provider ...") | ||
rate_provider = boa.load( | ||
"contracts/RateProvider.vy", address_provider.address | ||
) | ||
console.log("Adding rate provider to address provider") | ||
address_provider.add_new_id( | ||
18, rate_provider.address, "Spot Rate Provider" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
network = "arbitrum" | ||
url = "" | ||
fork = False | ||
|
||
if network == "zksync": | ||
import boa_zksync | ||
|
||
url = "https://mainnet.era.zksync.io" | ||
ADDRESS_PROVIDER = "0x54A5a69e17Aa6eB89d77aa3828E38C9Eb4fF263D" | ||
elif network == "fraxtal": | ||
network_url = "https://rpc.frax.com" | ||
elif network == "kava": | ||
network_url = "https://rpc.ankr.com/kava_evm" | ||
else: | ||
network_url = fetch_url(network) | ||
|
||
main(network, fork, network_url) |