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

feat: remove liquidity pool token manager from ITS #129

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ contract InterchainTokenService is
address internal immutable implementationMintBurn;
address internal immutable implementationMintBurnFrom;
address internal immutable implementationLockUnlockFee;
address internal immutable implementationLiquidityPool;
IAxelarGateway public immutable gateway;
IAxelarGasService public immutable gasService;
IRemoteAddressValidator public immutable remoteAddressValidator;
Expand All @@ -77,7 +76,7 @@ contract InterchainTokenService is
* @param gateway_ the address of the AxelarGateway.
* @param gasService_ the address of the AxelarGasService.
* @param remoteAddressValidator_ the address of the RemoteAddressValidator.
* @param tokenManagerImplementations this needs to have implementations in the order: Mint-burn, Mint-burn from, Lock-unlock, Lock-unlock with fee, and liquidity pool.
* @param tokenManagerImplementations this needs to have implementations in the order: Mint-burn, Mint-burn from, Lock-unlock, and Lock-unlock with fee.
*/
constructor(
address tokenManagerDeployer_,
Expand Down Expand Up @@ -107,7 +106,6 @@ contract InterchainTokenService is
implementationMintBurnFrom = _sanitizeTokenManagerImplementation(tokenManagerImplementations, TokenManagerType.MINT_BURN_FROM);
implementationLockUnlock = _sanitizeTokenManagerImplementation(tokenManagerImplementations, TokenManagerType.LOCK_UNLOCK);
implementationLockUnlockFee = _sanitizeTokenManagerImplementation(tokenManagerImplementations, TokenManagerType.LOCK_UNLOCK_FEE);
implementationLiquidityPool = _sanitizeTokenManagerImplementation(tokenManagerImplementations, TokenManagerType.LIQUIDITY_POOL);
string memory chainName_ = remoteAddressValidator.chainName();
chainNameHash = keccak256(bytes(chainName_));
}
Expand Down Expand Up @@ -220,7 +218,6 @@ contract InterchainTokenService is
if (TokenManagerType(tokenManagerType) == TokenManagerType.MINT_BURN_FROM) return implementationMintBurnFrom;
if (TokenManagerType(tokenManagerType) == TokenManagerType.LOCK_UNLOCK) return implementationLockUnlock;
if (TokenManagerType(tokenManagerType) == TokenManagerType.LOCK_UNLOCK_FEE) return implementationLockUnlockFee;
if (TokenManagerType(tokenManagerType) == TokenManagerType.LIQUIDITY_POOL) return implementationLiquidityPool;

revert InvalidImplementation();
}
Expand Down
3 changes: 1 addition & 2 deletions contracts/interfaces/ITokenManagerType.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ interface ITokenManagerType {
MINT_BURN,
MINT_BURN_FROM,
LOCK_UNLOCK,
LOCK_UNLOCK_FEE,
LIQUIDITY_POOL
LOCK_UNLOCK_FEE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract TokenManagerLiquidityPool is TokenManager, NoReEntrancy, ITokenManagerL
constructor(address interchainTokenService_) TokenManager(interchainTokenService_) {}

function implementationType() external pure returns (uint256) {
return uint256(TokenManagerType.LIQUIDITY_POOL);
revert('Not supported');
}

/**
Expand Down
3 changes: 2 additions & 1 deletion scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function deployInterchainTokenService(
async function deployTokenManagerImplementations(wallet, interchainTokenServiceAddress) {
const implementations = [];

for (const type of ['MintBurn', 'MintBurnFrom', 'LockUnlock', 'LockUnlockFee', 'LiquidityPool']) {
for (const type of ['MintBurn', 'MintBurnFrom', 'LockUnlock', 'LockUnlockFee']) {
const impl = await deployContract(wallet, `TokenManager${type}`, [interchainTokenServiceAddress]);
implementations.push(impl);
}
Expand Down Expand Up @@ -96,6 +96,7 @@ async function deployAll(wallet, chainName, evmChains = [], deploymentKey = 'int
tokenManagerImplementations.map((impl) => impl.address),
deploymentKey,
);

return [service, gateway, gasService];
}

Expand Down
Loading
Loading