-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: custom token registrars #116
Merged
Merged
Changes from 39 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
e9c1939
Added a canonical token registrar.
Foivos 10e4503
wrote some canonical token registrar tests
Foivos 2866ecf
made the standardized token registrar
Foivos 1127093
Wrote some basic tests
Foivos 943de1f
Merge remote-tracking branch 'origin/main' into feat/custom-token-reg…
Foivos 09b66bb
lint and fix a merge bug
Foivos f4ef75b
feat: bump to latest gmp-sdk and cgp
milapsheth 4569336
Merge branch 'axe-2034' into feat/custom-token-registars
milapsheth 14fecc4
rebase over dep bump
milapsheth 8682513
Merge branch 'main' into feat/custom-token-registars
milapsheth 1bd5f9b
clean lock file
milapsheth 3391cd8
Merge branch 'main' into feat/custom-token-registars
milapsheth f82b23c
Merge branch 'main' into feat/custom-token-registars
milapsheth f0a7e29
slither checks
milapsheth 04972f9
Merge branch 'main' into feat/custom-token-registars
milapsheth df97235
Added roles, tests pending
Foivos 8ea68ca
fix: tests
afdb98d
Merge remote-tracking branch 'origin/main' into feat/roles
fc0d72b
Added some tests and fixed constants
Foivos 4b0586d
made lint happy
Foivos 8c28d6d
Chnaged roles constants to enum to make slither happy
Foivos 3ef1db2
Fixed tests
Foivos 1566fec
Merge branch 'main' into feat/custom-token-registars
milapsheth ed4be65
querrying chain name from the remoteAddressValidator for the registrars
Foivos 4ec3612
Merge remote-tracking branch 'origin/feat/custom-token-registars' int…
Foivos 844bfb6
Merge remote-tracking branch 'origin/feat/roles' into feat/custom-tok…
Foivos a8db922
stash to add more utils to roles.
Foivos 6c4e38f
Added getter for distributor and opearator.
Foivos 51a3ce4
made lint happy
Foivos 68fcbdd
fixed a spelling error
Foivos 7b69d55
Merge branch 'feat/roles' into feat/custom-token-registars
Foivos 7815108
Fixed tests and interfaces
Foivos de5bcda
Removed a lot of unused imports and made routers upgradable.
Foivos fe2af9f
Merge remote-tracking branch 'origin/main' into feat/roles
Foivos 6147bf3
Merge remote-tracking branch 'origin/main' into feat/custom-token-reg…
Foivos 09fa22d
Merge branch 'feat/roles' into feat/custom-token-registars
Foivos 551f67e
Addressed changes
Foivos a6216f0
update for the new roles functions
Foivos 992ba96
Merge branch 'feat/roles' into feat/custom-token-registars
Foivos 05c1855
allow for mintAmount for standardized tokens
Foivos a593d69
Merge remote-tracking branch 'origin/main' into feat/roles
Foivos 2831316
update sdk
Foivos 394dca9
Merge branch 'main' into feat/roles
Foivos c555815
updage to newest sdk
Foivos fc791d1
made lint happy
Foivos 6cc49c0
Merge branch 'feat/roles' into feat/custom-token-registars
Foivos b8ab648
added some changes
Foivos a8aac7d
Merge remote-tracking branch 'origin/main' into feat/custom-token-reg…
Foivos 7d4d5bd
Added some utilities
Foivos ca65004
made lint happy
Foivos f190a59
Merge branch 'main' into feat/custom-token-registars
milapsheth 9ac0cf7
fix test
milapsheth 3b76ac1
build warnings
milapsheth 44dc8fc
revert fix
milapsheth 83353a6
fix create3 deployer reference
milapsheth e692dbc
fix test
milapsheth f2d76c2
slither warnings
milapsheth 0f78048
switch proxies
milapsheth f7f4b47
fix import
milapsheth 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
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
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,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
interface ICanonicalTokenRegistrar { | ||
error ZeroAddress(); | ||
|
||
function chainNameHash() external view returns (bytes32); | ||
|
||
function getCanonicalTokenSalt(address tokenAddress) external view returns (bytes32 salt); | ||
|
||
function getCanonicalTokenId(address tokenAddress) external view returns (bytes32 tokenId); | ||
|
||
function registerCanonicalToken(address tokenAddress) external payable returns (bytes32 tokenId); | ||
|
||
function deployAndRegisterRemoteCanonicalToken(bytes32 salt, string calldata destinationChain, uint256 gasValue) external payable; | ||
} |
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
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
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,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
interface IStandardizedTokenRegistrar { | ||
error ZeroAddress(); | ||
error NotDistributor(address distributor); | ||
error NotOperator(address operator); | ||
|
||
function chainNameHash() external view returns (bytes32); | ||
|
||
function getStandardizedTokenSalt(address deployer, bytes32 salt) external view returns (bytes32); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same get comment |
||
|
||
function getStandardizedTokenId(address deployer, bytes32 salt) external view returns (bytes32 tokenId); | ||
|
||
function getStandardizedTokenAddress(address deployer, bytes32 salt) external view returns (address tokenAddress); | ||
|
||
function deployStandardizedToken( | ||
bytes32 salt, | ||
string calldata name, | ||
string calldata symbol, | ||
uint8 decimals, | ||
uint256 mintAmount, | ||
address distributor | ||
) external payable; | ||
|
||
function deployRemoteStandarizedToken( | ||
bytes32 salt, | ||
address additionalDistributor, | ||
address optionalOperator, | ||
string memory destinationChain, | ||
uint256 gasValue | ||
) external payable; | ||
} |
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
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,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { FinalProxy } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/FinalProxy.sol'; | ||
|
||
/** | ||
* @title InterchainTokenServiceProxy | ||
* @dev Proxy contract for interchain token service contracts. Inherits from the FinalProxy contract. | ||
*/ | ||
contract CanonicalTokenRegistrarProxy is FinalProxy { | ||
bytes32 private constant CONTRACT_ID = keccak256('canonical-token-registrar'); | ||
|
||
/** | ||
* @dev Constructs the InterchainTokenServiceProxy contract. | ||
* @param implementationAddress Address of the interchain token service implementation | ||
* @param owner Address of the owner of the proxy | ||
*/ | ||
constructor(address implementationAddress, address owner) FinalProxy(implementationAddress, owner, '') {} | ||
|
||
/** | ||
* @dev Override for the 'contractId' function in FinalProxy. Returns a unique identifier for this contract. | ||
* @return bytes32 identifier for this contract | ||
*/ | ||
function contractId() internal pure override returns (bytes32) { | ||
return CONTRACT_ID; | ||
} | ||
} |
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,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { FinalProxy } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/FinalProxy.sol'; | ||
|
||
/** | ||
* @title InterchainTokenServiceProxy | ||
* @dev Proxy contract for interchain token service contracts. Inherits from the FinalProxy contract. | ||
*/ | ||
contract StandardizedTokenRegistrarProxy is FinalProxy { | ||
bytes32 private constant CONTRACT_ID = keccak256('standardized-token-registrar'); | ||
|
||
/** | ||
* @dev Constructs the InterchainTokenServiceProxy contract. | ||
* @param implementationAddress Address of the interchain token service implementation | ||
* @param owner Address of the owner of the proxy | ||
*/ | ||
constructor(address implementationAddress, address owner) FinalProxy(implementationAddress, owner, '') {} | ||
milapsheth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @dev Override for the 'contractId' function in FinalProxy. Returns a unique identifier for this contract. | ||
* @return bytes32 identifier for this contract | ||
*/ | ||
function contractId() internal pure override returns (bytes32) { | ||
return CONTRACT_ID; | ||
} | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
remove get prefix from registrar contracts as well (along with ITS)