-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move views out of serivce (#98)
* renamed folder and changed version * npmignore * npmignore * change version * using include pattern instead. * Fixed most of the things least auhority suggested. * made lint happy * Apply suggestions from code review * fixed some bugs * added events * rename set to transfer for distributor and operator * changed standardized token to always allow token managers to mint/burn it. * using immutable storage for remoteAddressValidator address to save gas * Added some recommended changes * added milap's suggested changes * Fixed some names and some minor gas optimizations * prettier and lint * stash * import .env in hardhat.config * trying to fix .env.example * Added some getters in IRemoteAddressValidator and removed useless check for distributor in the InterchainTokenService. * removed ternary operators * made lint happy * made lint happy * Added a new token manager to handle fee on transfer and added some tests for it as well * fixed the liquidity pool check. * fix a duplication bug * lint * added some more tests * Added more tests * Added proper re-entrancy protection for fee on transfer token managers. * change to tx.origin for refunds * Added support for more kinds of addresses. * some minor gas opts * some more gas optimizations. * Added a getter for chain name to the remote address validator. * moved the tokenManager getter functionality to a separate contract which saves almost a kilobyte of codesize. * made lint happy * Removed tokenManagerGetter and put params into tokenManagers * Added separate tokenManager interfaces * fix(RemoteAddressValidator): merge conflicts --------- Co-authored-by: Milap Sheth <[email protected]> Co-authored-by: Kiryl Yermakou <[email protected]>
- Loading branch information
1 parent
950fc9e
commit dc5dc8f
Showing
16 changed files
with
183 additions
and
98 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
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,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { ITokenManager } from './ITokenManager.sol'; | ||
|
||
/** | ||
* @title ITokenManager | ||
* @notice This contract is responsible for handling tokens before initiating a cross chain token transfer, or after receiving one. | ||
*/ | ||
interface ITokenManagerLiquidityPool is ITokenManager { | ||
/** | ||
* @notice Getter function for the parameters of a lock/unlock TokenManager. Mainly to be used by frontends. | ||
* @param operator the operator of the TokenManager. | ||
* @param tokenAddress the token to be managed. | ||
* @return params the resulting params to be passed to custom TokenManager deployments. | ||
*/ | ||
function getParams(bytes memory operator, address tokenAddress, address liquidityPool) external pure returns (bytes memory params); | ||
|
||
/** | ||
* @dev Reads the stored liquidity pool address from the specified storage slot | ||
* @return liquidityPool_ The address of the liquidity pool | ||
*/ | ||
function liquidityPool() external view returns (address liquidityPool_); | ||
|
||
/** | ||
* @dev Updates the address of the liquidity pool. Can only be called by the operator. | ||
* @param newLiquidityPool The new address of the liquidity pool | ||
*/ | ||
function setLiquidityPool(address newLiquidityPool) external; | ||
} |
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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { ITokenManager } from './ITokenManager.sol'; | ||
|
||
/** | ||
* @title ITokenManager | ||
* @notice This contract is responsible for handling tokens before initiating a cross chain token transfer, or after receiving one. | ||
*/ | ||
interface ITokenManagerLockUnlock is ITokenManager { | ||
/** | ||
* @notice Getter function for the parameters of a lock/unlock TokenManager. Mainly to be used by frontends. | ||
* @param operator the operator of the TokenManager. | ||
* @param tokenAddress the token to be managed. | ||
* @return params the resulting params to be passed to custom TokenManager deployments. | ||
*/ | ||
function getParams(bytes memory operator, address tokenAddress) external pure returns (bytes memory params); | ||
} |
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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { ITokenManager } from './ITokenManager.sol'; | ||
|
||
/** | ||
* @title ITokenManager | ||
* @notice This contract is responsible for handling tokens before initiating a cross chain token transfer, or after receiving one. | ||
*/ | ||
interface ITokenManagerLockUnlockFee is ITokenManager { | ||
/** | ||
* @notice Getter function for the parameters of a lock/unlock TokenManager. Mainly to be used by frontends. | ||
* @param operator the operator of the TokenManager. | ||
* @param tokenAddress the token to be managed. | ||
* @return params the resulting params to be passed to custom TokenManager deployments. | ||
*/ | ||
function getParams(bytes memory operator, address tokenAddress) external pure returns (bytes memory params); | ||
} |
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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import { ITokenManager } from './ITokenManager.sol'; | ||
|
||
/** | ||
* @title ITokenManager | ||
* @notice This contract is responsible for handling tokens before initiating a cross chain token transfer, or after receiving one. | ||
*/ | ||
interface ITokenManagerMintBurn is ITokenManager { | ||
/** | ||
* @notice Getter function for the parameters of a lock/unlock TokenManager. Mainly to be used by frontends. | ||
* @param operator the operator of the TokenManager. | ||
* @param tokenAddress the token to be managed. | ||
* @return params the resulting params to be passed to custom TokenManager deployments. | ||
*/ | ||
function getParams(bytes memory operator, address tokenAddress) external pure returns (bytes memory params); | ||
} |
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
Oops, something went wrong.