Skip to content

Commit

Permalink
Add deployment files
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Nov 22, 2023
1 parent aa52864 commit 8635d34
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 deletions.
1 change: 1 addition & 0 deletions brownie-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dotenv: .env
dependencies:
- OpenZeppelin/openzeppelin-contracts@4.6.0
- OpenZeppelin/openzeppelin-contracts-upgradeable@4.6.0
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions build/deployments/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"0x9c354503C38481a7A7a51629142963F98eCC12D0"
],
"Governance": [
"0xC6a3525e2FD8F4844a6fdfE4552a583CE5aC7EfA",
"0x3cdD07c16614059e66344a7b579DAB4f9516C0b6"
"0x3cdD07c16614059e66344a7b579DAB4f9516C0b6",
"0xC6a3525e2FD8F4844a6fdfE4552a583CE5aC7EfA"
],
"MandatoryLockupDistributor": [
"0xD667091c2d1DCc8620f4eaEA254CdFB0a176718D"
],
"OgvStaking": [
"0xFd8e7DAcC16c3807E66FEdD4F7c65f26B1fEE558",
"0xE61110663334794abA03c349c621A075DC590a42",
"0xe61110663334794aba03c349c621a075dc590a42"
],
Expand All @@ -22,6 +23,7 @@
"0x7aE2334f12a449895AD21d4c255D9DE194fe986f"
],
"OriginDollarGovernance": [
"0x190140d8D1815f6f92FD58DF0dacB758276fFFDB",
"0x7DFAFe7d547Fc9083719D633B9c5f6f542C42c77",
"0xEd6E3808FCe0C4A52DEa8636933f666c6dea4d1d",
"0x6cE89Ff1E8a910007BAc236C27B88f8a95B0bFaD"
Expand All @@ -33,8 +35,8 @@
"0x7d82E86CF1496f9485a8ea04012afeb3C7489397"
],
"Timelock": [
"0xac126C98cFc7c55a9F944770cb17d7065688C577",
"0x35918cDE7233F2dD33fA41ae3Cb6aE0e42E0e69F"
"0x35918cDE7233F2dD33fA41ae3Cb6aE0e42E0e69F",
"0xac126C98cFc7c55a9F944770cb17d7065688C577"
]
},
"4": {
Expand Down
39 changes: 25 additions & 14 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@ def governanceProposal(deployment):

if (len(actions) > 0):
ogvGovernor = Contract.from_explorer(GOVERNOR_FIVE)
with TemporaryFork():

proposal_args = [
[action['contract'].address for action in actions],
[0 for action in actions],
[action['signature'] for action in actions],
# To explain this code salad:
# - action['signature'][:action['signature'].index('(')] -> this part gets the function name from signature
# - encode_input(*action['args']) -> encodes said function data
# - [10:] trim first 10 character to trim function name signature away from data
[getattr(action['contract'], action['signature'][:action['signature'].index('(')]).encode_input(*action['args'])[10:] for action in actions],
deploymentInfo['name'],
]

if is_fork:
print('Creating governance proposal on fork')
propose_tx = ogvGovernor.propose(
[action['contract'].address for action in actions],
[0 for action in actions],
[action['signature'] for action in actions],
# To explain this code salad:
# - action['signature'][:action['signature'].index('(')] -> this part gets the function name from signature
# - encode_input(*action['args']) -> encodes said function data
# - [10:] trim first 10 character to trim function name signature away from data
[getattr(action['contract'], action['signature'][:action['signature'].index('(')]).encode_input(*action['args'])[10:] for action in actions],
deploymentInfo['name'],
ogvGovernor.propose(
*proposal_args,
{'from': GOV_MULTISIG}
)
# Simulate execution on fork
proposalId = propose_tx.events['ProposalCreated'][0][0]['proposalId']

# Move forward 30s so that we can vote
Expand All @@ -69,10 +73,17 @@ def governanceProposal(deployment):
print("Executing proposal")
ogvGovernor.execute(proposalId, {'from': GOV_MULTISIG})

else:
propose_data = ogvGovernor.propose.encode_input(
*proposal_args
)

print("Raw Args", proposal_args)

print("Execute the following transaction to create OGV Governance proposal")
print("To: {}".format(propose_tx.receiver))
print("Data: {}".format(propose_tx.input))
print("To: {}".format(GOVERNOR_FIVE))
print("Data: {}".format(propose_data))


def timetravel(seconds):
brownie.chain.sleep(seconds + 1)
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy_005_rebranding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
def main():
def deployment(deployer, FROM_DEPLOYER, local_provider, is_mainnet, is_fork, is_proposal_mode):
# Existing contracts
veogv_proxy = OgvStakingProxy.at(VEOGV_PROXY_ADDRESS)
ogv_proxy = OriginDollarGovernance.at(OGV_PROXY_ADDRESS)
governance = Governance.at(GOVERNANCE_ADDRESS)
veogv_proxy = Contract.from_abi("OgvStakingProxy", VEOGV_PROXY_ADDRESS, OgvStakingProxy.abi)
ogv_proxy = Contract.from_abi("OriginDollarGovernance", OGV_PROXY_ADDRESS, OriginDollarGovernance.abi)
governance = Contract.from_abi("Governance", GOVERNANCE_ADDRESS, Governance.abi)

if not is_fork:
# Dynamicly price gas, avoids over paying or TX's getting stuck
priority_fee("2 gwei")
Expand Down

0 comments on commit 8635d34

Please sign in to comment.