-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy factory multi chain #2
Open
venkatkalyan18
wants to merge
6
commits into
catalystsystem:main
Choose a base branch
from
venkatkalyan18:DeployFactoryMultiChain
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule catERC20
added at
621823
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.18; | ||
|
||
import { Script, console } from 'forge-std/Script.sol'; | ||
import { BaseMultiChainDeployer } from 'GeneralisedIncentives/script/BaseMultiChainDeployer.s.sol'; | ||
import { CatERC20Factory } from '../src/catERC20Factory.sol'; | ||
|
||
contract DeployFactory is BaseMultiChainDeployer { | ||
|
||
CatERC20Factory public catERC20Factory; | ||
bytes32 constant salt = 0x1234567890abcdef1234567890abcdef1239967890abcdef1234567890abcdef; | ||
|
||
function _deployFactory() internal { | ||
catERC20Factory = new CatERC20Factory{salt: salt}(); | ||
console.log("CatERC20Factory deployed at:", address(catERC20Factory)); | ||
} | ||
|
||
function _deployXERC20() internal { | ||
catERC20Factory = new CatERC20Factory{salt: salt}(); | ||
console.log("CatERC20Factory deployed at:", address(catERC20Factory)); | ||
|
||
uint256[] memory minterLimits = new uint256[](0); | ||
uint256[] memory burnerLimits = new uint256[](0); | ||
address[] memory bridges = new address[](0); | ||
|
||
address deployedToken = catERC20Factory.deployXERC20("Test", "TS", minterLimits, burnerLimits, bridges); | ||
console.log("ERC20 Token deployed at:", deployedToken); | ||
} | ||
|
||
// Function to deploy to all chains, with salt fixed | ||
function deployFactoryToAllChains() iter_chains(chain_list) broadcast external { | ||
_deployFactory(); | ||
} | ||
|
||
// Function to deploy to specific chains, with salt fixed | ||
function deployFactoryToAllChains(string[] memory chains) iter_chains_string(chains) broadcast public { | ||
_deployFactory(); | ||
} | ||
|
||
// Function to deploy to all chains, with salt fixed | ||
function deployXERC20ToAllChains() iter_chains(chain_list) broadcast external { | ||
_deployXERC20(); | ||
} | ||
|
||
// Function to deploy to specific chains, with salt fixed | ||
function deployXERC20ToAllChains(string[] memory chains) iter_chains_string(chains) broadcast public { | ||
_deployXERC20(); | ||
} | ||
|
||
|
||
} |
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 |
---|---|---|
|
@@ -282,4 +282,4 @@ contract CatERC20 is ERC20, Ownable, IXERC20 { | |
return uint256(int256(newCurrentLimit) + deltaLimit); | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deploy function does more than just deploy the factory now.
A deployment script should be explcit in what it does.
forge script DeployFactory --sig "deployToAllChains()"
should be expected to deploy the factory not also an xERC20 token.