Skip to content

Commit

Permalink
rm floatingCow, adds local fork deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
parseb committed May 21, 2022
1 parent 46cf20a commit 4163a1b
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 26 deletions.
3 changes: 0 additions & 3 deletions contracts/CashCow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -112,8 +111,6 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ"), MiniVest(k) {
_pitchDataURL
);

floatingCows.push(cashCowById[tId]);

tId = tempId;
unchecked {
tempId++;
Expand Down
2 changes: 2 additions & 0 deletions deployed_fork_local.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CashCow: 0x6951b5Bd815043E3F842c1b026b0Fa888Cc2DD85
ValueConduct: 0xe0aA552A10d7EC8760Fc6c246D391E698a82dDf9
7 changes: 5 additions & 2 deletions deployed_mumbai.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
CashCow: 0x4A35E3C88438e8e6eEdB1Ea31fe34be2D4234200
ValueConduct: 0x2ac65Be3f3aCA115Ae97669Dd3f0B8EA47A300Be
CashCow: 0x4099cB63098976aFb78686CF40A7AC0138D5863F
ValueConduct: 0x2ac65Be3f3aCA115Ae97669Dd3f0B8EA47A300Be

#CashCow Arbitrum Rinkeby: 0x9D4722d668C4b790ab670c229c336389056615cb

2 changes: 2 additions & 0 deletions ganache_start.sh
Original file line number Diff line number Diff line change
@@ -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

27 changes: 18 additions & 9 deletions scripts/deploy_arbitrum_testnet.py
Original file line number Diff line number Diff line change
@@ -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)
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()
32 changes: 32 additions & 0 deletions scripts/deploy_polygon_fork.py
Original file line number Diff line number Diff line change
@@ -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]})

12 changes: 0 additions & 12 deletions scripts/deploy_test1.py

This file was deleted.

6 changes: 6 additions & 0 deletions scripts/feed_accounts.py
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions unlocked_accounts_polygon.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unlock: ["0xb3F204a5F3dabef6bE51015fD57E307080Db6498","0x7Dd1CFBed7723DfE959EE776b18C5E1490993297","0xe7b30a037f5598e4e73702ca66a59af5cc650dcd","0x075e72a5edf65f0a5f44699c7654c1a76941ddc8"]

0 comments on commit 4163a1b

Please sign in to comment.