-
Notifications
You must be signed in to change notification settings - Fork 70
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
ICTT Deployment Fixes #2227
ICTT Deployment Fixes #2227
Conversation
@@ -458,6 +459,7 @@ func TokenHomeAddCollateral( | |||
remoteAddress common.Address, | |||
amount *big.Int, | |||
) error { | |||
ux.Logger.PrintToUser("Collateralizing remote contract on the home chain") |
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.
should we add action description logs to this lib? besides this, should we pass the logger as an arg?
rpcURL string, | ||
privateKey string, | ||
remoteAddress common.Address, | ||
) error { | ||
ux.Logger.PrintToUser("Registering remote contract with home contract") |
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.
same comment on logs
// Get the decimal count for the token to format the balance. | ||
// Note: decimals() is not officially part of the IERC20 interface, but is a common extension. | ||
decimals, err := token.Decimals(nil) | ||
if err != nil { |
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.
should we default to some standard decimal in case of error for not being official?
homeKeyAddress = crypto.PubkeyToAddress(pk.PublicKey).Hex() | ||
// Get the key to be used to deploy the token home contract and collateralize the remote | ||
// in the case that it is a native token remote. | ||
homeKey, homeKeyAddress, err := getHomeKeyAndAddress(app, network, flags.homeFlags) |
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.
previously the bug was not asking for it when needed, but now it may also ask for it when not needed,
as in the case the home preexists and there is no collateralization needed.
Why this should be merged
homeKey
was left uninitialized prior to use when using an existingTokenHome
contract and deploying a newNativeTokenRemote
TokenHome
contract was previously in the remote denomination. Now it uses the correct amount in the home denomination, as reported by the home contract.How this works
decimals()
count ifuseGwei
is false.How this was tested
Going through the flow of running
avalanche ictt deploy --deploy-native-remote
for a Fuji L1, and deploying aNativeTokenRemote
connected to the existing USDCTokenHome
contract on the C-ChainHow is this documented
N/A