Added sanity checks in settle() token pools

This commit is contained in:
Thrilok Kumar 2020-10-07 20:46:17 +05:30
parent df780b55a0
commit d3b423ba62
2 changed files with 2 additions and 0 deletions

View File

@ -105,6 +105,7 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
* @param _data array of connector's function calldata * @param _data array of connector's function calldata
*/ */
function settle(address[] calldata _targets, bytes[] calldata _data) external isChief { function settle(address[] calldata _targets, bytes[] calldata _data) external isChief {
require(_targets.length != 0, "targets-length-zero");
require(_targets.length == _data.length , "array-length-invalid"); require(_targets.length == _data.length , "array-length-invalid");
require(registry.checkSettleLogics(address(this), _targets), "not-logic"); require(registry.checkSettleLogics(address(this), _targets), "not-logic");
for (uint i = 0; i < _targets.length; i++) { for (uint i = 0; i < _targets.length; i++) {

View File

@ -102,6 +102,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
* @param _data array of connector's function calldata * @param _data array of connector's function calldata
*/ */
function settle(address[] calldata _targets, bytes[] calldata _data) external isChief { function settle(address[] calldata _targets, bytes[] calldata _data) external isChief {
require(_targets.length != 0, "targets-length-zero");
require(_targets.length == _data.length , "array-length-invalid"); require(_targets.length == _data.length , "array-length-invalid");
require(registry.checkSettleLogics(address(this), _targets), "not-logic"); require(registry.checkSettleLogics(address(this), _targets), "not-logic");
for (uint i = 0; i < _targets.length; i++) { for (uint i = 0; i < _targets.length; i++) {