-
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.
Merge pull request #15 from curvefi/update_twocryptong_implementation
Update twocryptong implementation
- Loading branch information
Showing
8 changed files
with
10,186 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,3 +149,4 @@ node_modules | |
# temp | ||
docs/ | ||
scripts/experiments/get_p.py | ||
*.csv |
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
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 |
---|---|---|
@@ -1,96 +1,132 @@ | ||
arbitrum:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: 0x2005995a71243be9FB995DaB4742327dc76564Df. | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
aurora:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
avax:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
base:mainnet: | ||
amm: '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495' | ||
factory: '0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F' | ||
math: '0x64379C265Fc6595065D7d835AAaa731c0584dB80' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x64379C265Fc6595065D7d835AAaa731c0584dB80' | ||
views: '0xd3B17f862956464ae4403cCF829CE69199856e1e' | ||
bsc:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
celo:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
ethereum:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
gauge: '0x38D9BdA812da2C68dFC6aDE85A7F7a54E77F8325' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
ethereum:sepolia: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
fraxtal:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
ftm:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
gnosis:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
kava:mainnet: | ||
amm: '0x64379C265Fc6595065D7d835AAaa731c0584dB80' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x64379C265Fc6595065D7d835AAaa731c0584dB80' | ||
factory: '0xd3B17f862956464ae4403cCF829CE69199856e1e' | ||
math: '0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a' | ||
views: '0x0C9D8c7e486e822C29488Ff51BFf0167B4650953' | ||
linea:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
mantle:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
optimism:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
polygon:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
pzkevm:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
scroll:mainnet: | ||
amm: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0x04Fd6beC7D45EFA99a27D29FB94b55c56dD07223' | ||
factory: '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F' | ||
math: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x2005995a71243be9FB995DaB4742327dc76564Df' | ||
views: '0x07CdEBF81977E111B08C126DEFA07818d0045b80' | ||
xlayer:mainnet: | ||
amm: '0xFAbC421e3368D158d802684A217a83c083c94CeB' | ||
amm: '0x934791f7F391727db92BFF94cd789c4623d14c52' | ||
amm_v2_0_0: '0xFAbC421e3368D158d802684A217a83c083c94CeB' | ||
factory: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf' | ||
math: '0x505d666E4DD174DcDD7FA090ed95554486d2Be44' | ||
math: '0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1' | ||
math_v2_0_0: '0x505d666E4DD174DcDD7FA090ed95554486d2Be44' | ||
views: '0x5a8C93EE12a8Df4455BA111647AdA41f29D5CfcC' |
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,106 @@ | ||
# flake8: noqa E501 | ||
|
||
import os | ||
import sys | ||
|
||
import boa | ||
import deployment_utils as deploy_utils | ||
import yaml | ||
from boa.network import NetworkEnv | ||
from eth_account import Account | ||
from rich.console import Console as RichConsole | ||
|
||
sys.path.append("./") | ||
from scripts.deploy_infra import check_and_deploy | ||
|
||
logger = RichConsole(file=sys.stdout) | ||
|
||
|
||
def fetch_url(network): | ||
return os.getenv("DRPC_URL") % (network, os.getenv("DRPC_KEY")) | ||
|
||
|
||
def deploy(network, url, account, fork=False): | ||
|
||
logger.log(f"Deploying on {network} ...") | ||
|
||
if not url: | ||
url = fetch_url(network.split(":")[0]) | ||
|
||
if fork: | ||
boa.env.fork(url) | ||
logger.log("Forkmode ...") | ||
boa.env.eoa = deploy_utils.FIDDYDEPLOYER # set eoa address here | ||
else: | ||
logger.log("Prodmode ...") | ||
boa.set_env(NetworkEnv(url)) | ||
boa.env.add_account(Account.from_key(os.environ[account])) | ||
|
||
CREATE2DEPLOYER = boa.load_abi("abi/create2deployer.json").at( | ||
"0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2" | ||
) | ||
|
||
with open("./deployments.yaml", "r") as file: | ||
deployments = yaml.safe_load(file) | ||
|
||
factory = boa.load_partial("./contracts/main/CurveTwocryptoFactory.vy").at( | ||
deployments[network]["factory"] | ||
) | ||
|
||
math_contract_obj = boa.load_partial( | ||
"./contracts/main/CurveCryptoMathOptimized2.vy" | ||
) | ||
amm_contract_obj = boa.load_partial( | ||
"./contracts/main/CurveTwocryptoOptimized.vy" | ||
) | ||
|
||
math_contract = check_and_deploy( | ||
contract_obj=math_contract_obj, | ||
contract_designation="math", | ||
network=network, | ||
create2deployer=CREATE2DEPLOYER, | ||
calculated_address="0x1Fd8Af16DC4BEBd950521308D55d0543b6cDF4A1", | ||
upkeep_deploy_log=not fork, | ||
) | ||
|
||
amm_blueprint = check_and_deploy( | ||
contract_obj=amm_contract_obj, | ||
contract_designation="amm", | ||
network=network, | ||
create2deployer=CREATE2DEPLOYER, | ||
calculated_address="0x934791f7F391727db92BFF94cd789c4623d14c52", | ||
blueprint=True, | ||
upkeep_deploy_log=not fork, | ||
) | ||
|
||
if boa.env.eoa == factory.admin(): | ||
|
||
# update implementation here | ||
if not factory.pool_implementations(0) == amm_blueprint.address: | ||
logger.log("Setting AMM implementation ...") | ||
factory.set_pool_implementation(amm_blueprint, 0) | ||
|
||
if not factory.math_implementation() == math_contract.address: | ||
logger.log("Setting Math implementation ...") | ||
factory.set_math_implementation(math_contract) | ||
|
||
logger.log("Done!") | ||
|
||
else: | ||
|
||
logger.log(f"Could not update implementation for factory on {network}") | ||
|
||
|
||
def main(): | ||
|
||
forkmode = False | ||
deploy( | ||
network="", | ||
url="", | ||
account="", | ||
fork=forkmode, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Oops, something went wrong.