Skip to content
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
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

venkatkalyan18
Copy link

No description provided.

Copy link
Member

@reednaa reednaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should try to maintain good code quality changes.

  • Don't commit files that are not relevant
  • Don't commit changes to files that aren't part of the change scope.

You should use the short hand for Create2 rather than write a decidated script. See the shorthand for create2 here: https://github.com/catalystdao/catERC20/blob/6218231756d98cbbc96e110f4b2577c4faf5164b/src/catERC20Factory.sol#L101

foundry.toml Outdated
@@ -3,4 +3,5 @@ src = "src"
out = "out"
libs = ["lib"]


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change files when not relevant

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not resolved.

revert Create2EmptyBytecode();
}
assembly {
addr := create2(callvalue(), add(creationCode, 0x20), mload(creationCode), salt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use assembly. Furthermore, I don't understand why this is payable or why we are forwarding the Ether on this call?

import { CatLockbox } from './CatLockbox.sol';
import { CatERC20 } from './catERC20.sol';
import { CatLockbox } from './catLockbox.sol';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change files when not relevant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not resolved.

Copy link
Member

@reednaa reednaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes looks good. However, there are still a few things that needs to be changed.

foundry.toml Outdated
@@ -3,4 +3,5 @@ src = "src"
out = "out"
libs = ["lib"]


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not resolved.

uint256[] memory burnerLimits = new uint256[](0);
address[] memory bridges = new address[](0);

address deployedToken = catERC20Factory.deployXERC20("Test", "TS", minterLimits, burnerLimits, bridges);
Copy link
Member

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.

src/catERC20.sol Outdated
@@ -245,6 +245,7 @@ contract CatERC20 is ERC20, Ownable, IXERC20 {
* @param deltaLimit The delta that has to be applied to the limit.
* @return newLimit The new current limit
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has also been edited now. See my other comments on not changing files which are not needed.

import { CatLockbox } from './CatLockbox.sol';
import { CatERC20 } from './catERC20.sol';
import { CatLockbox } from './catLockbox.sol';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants