-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8c1a97
commit 2bf290d
Showing
4 changed files
with
281 additions
and
11 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,52 @@ | ||
from ape import project, accounts, Contract, chain, networks | ||
from hexbytes import HexBytes | ||
from scripts.deployments import getSalt, deploy_contract | ||
|
||
|
||
def deploy_splitter_factory(): | ||
print("Deploying Splitter Factory on ChainID", chain.chain_id) | ||
|
||
if input("Do you want to continue? ") == "n": | ||
return | ||
|
||
splitter = project.Splitter | ||
splitter_factory = project.SplitterFactory | ||
|
||
deployer = input("Name of account to use? ") | ||
deployer = accounts.load(deployer) | ||
|
||
salt = getSalt("Splitter Factory") | ||
|
||
print(f"Salt we are using {salt}") | ||
print("Init balance:", deployer.balance / 1e18) | ||
|
||
print(f"Deploying Original.") | ||
|
||
original_deploy_bytecode = HexBytes( | ||
HexBytes(splitter.contract_type.deployment_bytecode.bytecode) | ||
) | ||
|
||
original_address = deploy_contract(original_deploy_bytecode, salt, deployer) | ||
|
||
print(f"Original deployed to {original_address}") | ||
|
||
allocator_constructor = splitter_factory.constructor.encode_input(original_address) | ||
|
||
# generate and deploy | ||
deploy_bytecode = HexBytes( | ||
HexBytes(splitter_factory.contract_type.deployment_bytecode.bytecode) | ||
+ allocator_constructor | ||
) | ||
|
||
print(f"Deploying the Factory...") | ||
|
||
deploy_contract(deploy_bytecode, salt, deployer) | ||
|
||
print("------------------") | ||
print( | ||
f"Encoded Constructor to use for verifaction {allocator_constructor.hex()[2:]}" | ||
) | ||
|
||
|
||
def main(): | ||
deploy_splitter_factory() |
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