Conversation
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol
Outdated
Show resolved
Hide resolved
| const contractRegistry = await web3Func(deploy, "contractRegistry", "ContractRegistry", []); | ||
| const converterFactory = await web3Func(deploy, "converterFactory", "ConverterFactory", []); | ||
| const sovrynSwapFormula = await web3Func(deploy, "sovrynSwapFormula", "SovrynSwapFormula", []); | ||
| const sovrynSwapNetwork = await web3Func(deploy, "sovrynSwapNetwork", "SovrynSwapNetwork", [contractRegistry._address]); | ||
| const converterUpgrader = await web3Func(deploy, "converterUpgrader", "ConverterUpgrader", [contractRegistry._address, addresses.ETH]); | ||
| const converterRegistry = await web3Func(deploy, "converterRegistry", "ConverterRegistry", [contractRegistry._address]); | ||
| const liquidityPoolV1ConverterFactory = await web3Func(deploy, "liquidityPoolV1ConverterFactory", "LiquidityPoolV1ConverterFactory", []); | ||
| const smartToken = await web3Func(deploy, "smartToken", "SmartToken", ["TOKEN", "TKN", 1]); | ||
| const oracle = await web3Func(deploy, "oracle", "Oracle", []); | ||
| const liquidityPoolV1Converter = await web3Func(deploy, "liquidityPoolV1Converter", "LiquidityPoolV1Converter", [smartToken._address, contractRegistry._address, MAX_CONVERSION_FEE]); | ||
|
|
||
| //init sovryn swap formula | ||
| await execute(sovrynSwapFormula.methods.init()); | ||
|
|
||
| // initialize contract registry | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("ContractRegistry"), contractRegistry._address)); | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("ConverterFactory"), converterFactory._address)); | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("SovrynSwapFormula"), sovrynSwapFormula._address)); | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("SovrynSwapNetwork"), sovrynSwapNetwork._address)); | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("SovrynSwapConverterUpgrader"), converterUpgrader._address)); | ||
| await execute(contractRegistry.methods.registerAddress(Web3.utils.asciiToHex("SovrynSwapConverterRegistry"), converterRegistry._address)); | ||
|
|
||
| // initialize converter factory | ||
| await execute(converterFactory.methods.registerTypedConverterFactory(liquidityPoolV1ConverterFactory._address)); |
There was a problem hiding this comment.
Do you mean this script not needed and I should add the oracle deployment to the test_deployment_rsk.js script?
There was a problem hiding this comment.
i mean why would you register all of these addresses again although they already have been registered on deployment?
There was a problem hiding this comment.
Oh okay. Adding oracle deployment to addConverter.js so this won't be needed.
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol
Outdated
Show resolved
Hide resolved
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol
Show resolved
Hide resolved
|
approved with one comment. |
|
would also be nice if
(the script is in an unmerged PR. we can't merge the whole PR, but you can copy the script) |
korepkorep
left a comment
There was a problem hiding this comment.
Several code quality issues that don't endanger contracts` security
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1Converter.sol
Outdated
Show resolved
Hide resolved
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1ConverterMultiAsset.sol
Outdated
Show resolved
Hide resolved
|
|
||
| // ensure that the trade won't deplete the reserve balance | ||
| uint256 targetReserveBalance = reserveBalance(_targetToken); | ||
| assert(amount < targetReserveBalance); |
There was a problem hiding this comment.
Using of assert in production source code is not the best practice. Same for other assert cases
|
|
||
| uint256[] memory reserveMinReturnAmounts = new uint256[](reserveTokens.length); | ||
| for (uint256 i = 0; i < reserveMinReturnAmounts.length; i++) | ||
| reserveMinReturnAmounts[i] = 1; |
solidity/contracts/converter/types/liquidity-pool-v1/LiquidityPoolV1ConverterMultiAsset.sol
Show resolved
Hide resolved
| // transfer funds from the caller in the reserve token | ||
| if (reserveToken == ETH_RESERVE_ADDRESS) { | ||
| if (msg.value > reserveAmount) { | ||
| msg.sender.transfer(msg.value - reserveAmount); |
There was a problem hiding this comment.
Some contracts may revert ether transfers due to lack of gas. Same for other .transfer cases
eMarchenko
left a comment
There was a problem hiding this comment.
@korepkorep has performed the review, no security issues have been discovered
…ship Multisig Pool Ownership
No description provided.