From 4163a1b56be30cca238f0cf2e9f0c3fdd6facfbc Mon Sep 17 00:00:00 2001 From: parseb Date: Sun, 22 May 2022 00:15:09 +0300 Subject: [PATCH] rm floatingCow, adds local fork deploy script --- contracts/CashCow.sol | 3 --- deployed_fork_local.txt | 2 ++ deployed_mumbai.txt | 7 +++++-- ganache_start.sh | 2 ++ scripts/deploy_arbitrum_testnet.py | 27 ++++++++++++++++--------- scripts/deploy_polygon_fork.py | 32 ++++++++++++++++++++++++++++++ scripts/deploy_test1.py | 12 ----------- scripts/feed_accounts.py | 6 ++++++ unlocked_accounts_polygon.txt | 1 + 9 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 deployed_fork_local.txt create mode 100644 ganache_start.sh create mode 100644 scripts/deploy_polygon_fork.py delete mode 100644 scripts/deploy_test1.py create mode 100644 scripts/feed_accounts.py create mode 100644 unlocked_accounts_polygon.txt diff --git a/contracts/CashCow.sol b/contracts/CashCow.sol index af1852d..3d20a17 100644 --- a/contracts/CashCow.sol +++ b/contracts/CashCow.sol @@ -62,7 +62,6 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ"), MiniVest(k) { mapping(uint256 => Cow) cashCowById; mapping(uint256 => string) _tokenURIs; - Cow[] public floatingCows; /// modifiers modifier timeElapsed(uint256 _id) { @@ -112,8 +111,6 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ"), MiniVest(k) { _pitchDataURL ); - floatingCows.push(cashCowById[tId]); - tId = tempId; unchecked { tempId++; diff --git a/deployed_fork_local.txt b/deployed_fork_local.txt new file mode 100644 index 0000000..b1d2aca --- /dev/null +++ b/deployed_fork_local.txt @@ -0,0 +1,2 @@ +CashCow: 0x6951b5Bd815043E3F842c1b026b0Fa888Cc2DD85 +ValueConduct: 0xe0aA552A10d7EC8760Fc6c246D391E698a82dDf9 \ No newline at end of file diff --git a/deployed_mumbai.txt b/deployed_mumbai.txt index 5c1133c..ece1082 100644 --- a/deployed_mumbai.txt +++ b/deployed_mumbai.txt @@ -1,2 +1,5 @@ -CashCow: 0x4A35E3C88438e8e6eEdB1Ea31fe34be2D4234200 -ValueConduct: 0x2ac65Be3f3aCA115Ae97669Dd3f0B8EA47A300Be \ No newline at end of file +CashCow: 0x4099cB63098976aFb78686CF40A7AC0138D5863F +ValueConduct: 0x2ac65Be3f3aCA115Ae97669Dd3f0B8EA47A300Be + +#CashCow Arbitrum Rinkeby: 0x9D4722d668C4b790ab670c229c336389056615cb + diff --git a/ganache_start.sh b/ganache_start.sh new file mode 100644 index 0000000..2d88f83 --- /dev/null +++ b/ganache_start.sh @@ -0,0 +1,2 @@ +ganache-cli --chain.vmErrorsOnRPCResponse true --server.port 8545 --miner.blockGasLimit 20000000 --wallet.totalAccounts 10 --hardfork istanbul --wallet.mnemonic brownie --wallet.unlockedAccounts 0xb3F204a5F3dabef6bE51015fD57E307080Db6498 --wallet.unlockedAccounts 0x7Dd1CFBed7723DfE959EE776b18C5E1490993297 --wallet.unlockedAccounts 0xe7b30a037f5598e4e73702ca66a59af5cc650dcd --wallet.unlockedAccounts 0x075e72a5edf65f0a5f44699c7654c1a76941ddc8 --fork.url $ALCHEMY_POLYGON_MAIN --chain.chainId 137 + diff --git a/scripts/deploy_arbitrum_testnet.py b/scripts/deploy_arbitrum_testnet.py index 4cd1fd0..bc33cf9 100644 --- a/scripts/deploy_arbitrum_testnet.py +++ b/scripts/deploy_arbitrum_testnet.py @@ -1,12 +1,21 @@ -# from brownie import CashCow, accounts +from brownie import CashCow, accounts, ValueConduct -# DAI_ADDR = "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735" #polygon mainnet -# # V3Factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984" -# sushiV2Router = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506" # polygon sushi router -# sushiV2Factory = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" # sushi factory +#DAI_ADDR = "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735" #polygon mainnet +# V3Factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984" +sushiV2Router = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506" # polygon sushi router - same arbitrum +sushiV2Factory = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" # sushi factory - same arbitrum +DAI_ADDR = "0xb47e6a5f8b33b3f17603c83a0535a9dcd7e32681" #WETH +## @todo flip publish_source to true on mainnet deployment. Arbitrum rinkeby does not support. -# def main(): -# acct = accounts.load('99') -# deployed_at = CashCow.deploy(DAI_ADDR, sushiV2Factory, sushiV2Router, {'from': acct}) -# print("CCOW deployed at: ", deployed_at) \ No newline at end of file +def main(): + acct = accounts.load('69') + deployed_at = CashCow.deploy(DAI_ADDR, sushiV2Factory, sushiV2Router, "0xE7b30A037F5598E4e73702ca66A59Af5CC650Dcd", {'from': acct}, publish_source=False) + print("CCOW deployed at: ", deployed_at.address) + + deployed2 = ValueConduct.deploy(acct.address ,{'from': acct}, publish_source=False) + print("ValueConduct deplyed at: ", deployed2.address) + + writetofile = open("deployed_arbitrum_rinkeby.txt", "w") + writetofile.write("CashCow: " + str(deployed_at) + "\n" + "ValueConduct: " + str(deployed2)) + writetofile.close() \ No newline at end of file diff --git a/scripts/deploy_polygon_fork.py b/scripts/deploy_polygon_fork.py new file mode 100644 index 0000000..c205e8b --- /dev/null +++ b/scripts/deploy_polygon_fork.py @@ -0,0 +1,32 @@ +from brownie import CashCow, ValueConduct, accounts, interface +from dbus import Interface + +#DAI_ADDR = "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735" #polygon mainnet +# V3Factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984" + +DAI_polygon = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063" +sushiV2Router = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506" # polygon sushi router +sushiV2Factory = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" # sushi factory + + +def main(): + acct = accounts[0] + deployed_at = CashCow.deploy(DAI_polygon, sushiV2Factory, sushiV2Router, "0xE7b30A037F5598E4e73702ca66A59Af5CC650Dcd", {'from': acct}) + print("CCOW deployed at: ", deployed_at.address) + + deployed2 = ValueConduct.deploy(acct.address ,{'from': acct}) + print("ValueConduct deplyed at: ", deployed2.address) + + writetofile = open("deployed_fork_local.txt", "w") + writetofile.write("CashCow: " + str(deployed_at) + "\n" + "ValueConduct: " + str(deployed2)) + writetofile.close() + + accounts[0].transfer("0xb3F204a5F3dabef6bE51015fD57E307080Db6498", 5*10**18) + accounts[0].transfer("0x7Dd1CFBed7723DfE959EE776b18C5E1490993297", 5*10**18) + interface.IERC20(DAI_polygon).transfer("0xb3F204a5F3dabef6bE51015fD57E307080Db6498", 5000*10**18, {'from': accounts[-1]}) + interface.IERC20(deployed2.address).transfer("0x7Dd1CFBed7723DfE959EE776b18C5E1490993297", 5000*10**18, {'from': accounts[0]}) + interface.IERC20(DAI_polygon).approve(deployed_at.address, 5000*10**18, {'from': accounts[-3]}) + interface.IERC20(DAI_polygon).approve(deployed_at.address, 5000*10**18, {'from': accounts[-4]}) + interface.IERC20(deployed2.address).approve(deployed_at.address, 5000*10**18, {'from': accounts[-3]}) + interface.IERC20(deployed2.address).approve(deployed_at.address, 5000*10**18, {'from': accounts[-4]}) + diff --git a/scripts/deploy_test1.py b/scripts/deploy_test1.py deleted file mode 100644 index a4e2462..0000000 --- a/scripts/deploy_test1.py +++ /dev/null @@ -1,12 +0,0 @@ -from brownie import CashCow, accounts - -DAI_ADDR = "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735" #polygon mainnet -# V3Factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984" -sushiV2Router = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506" # polygon sushi router -sushiV2Factory = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" # sushi factory - - -def main(): - acct = accounts.load('99') - deployed_at = CashCow.deploy(DAI_ADDR, sushiV2Factory, sushiV2Router, {'from': acct}) - print("CCOW deployed at: ", deployed_at) \ No newline at end of file diff --git a/scripts/feed_accounts.py b/scripts/feed_accounts.py new file mode 100644 index 0000000..41b5dd6 --- /dev/null +++ b/scripts/feed_accounts.py @@ -0,0 +1,6 @@ +# from brownie import CashCow, accounts, ValueConduct, interfaces + + +# def main(): +# deployed1 = CashCow.deploy(DAI_ADDR, V3Factory, sushiV2Router, sweeper, {'from': accounts[0]}) +# return deployed1 \ No newline at end of file diff --git a/unlocked_accounts_polygon.txt b/unlocked_accounts_polygon.txt new file mode 100644 index 0000000..dbea257 --- /dev/null +++ b/unlocked_accounts_polygon.txt @@ -0,0 +1 @@ +unlock: ["0xb3F204a5F3dabef6bE51015fD57E307080Db6498","0x7Dd1CFBed7723DfE959EE776b18C5E1490993297","0xe7b30a037f5598e4e73702ca66a59af5cc650dcd","0x075e72a5edf65f0a5f44699c7654c1a76941ddc8"]