From 349cb1104025a776a106f895ae09adc148209f25 Mon Sep 17 00:00:00 2001 From: Sudipta Basak <41054678+sudiptab2100@users.noreply.github.com> Date: Mon, 19 Jul 2021 22:11:57 +0530 Subject: [PATCH] Update SimpleMultiSig.sol Modified the code for latest solidity versions --- contracts/SimpleMultiSig.sol | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contracts/SimpleMultiSig.sol b/contracts/SimpleMultiSig.sol index 34036c5..3848308 100644 --- a/contracts/SimpleMultiSig.sol +++ b/contracts/SimpleMultiSig.sol @@ -1,4 +1,5 @@ -pragma solidity ^0.4.24; +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.4; contract SimpleMultiSig { @@ -25,7 +26,7 @@ bytes32 constant SALT = 0x251543af6a222378665a76fe38dbceae4871a070b7fdaf5c6c30cf bytes32 DOMAIN_SEPARATOR; // hash for EIP712, computed from contract address // Note that owners_ must be strictly increasing, in order to prevent duplicates - constructor(uint threshold_, address[] owners_, uint chainId) public { + constructor(uint threshold_, address[] memory owners_, uint chainId) { require(owners_.length <= 10 && threshold_ <= owners_.length && threshold_ > 0); address lastAdd = address(0); @@ -46,7 +47,7 @@ bytes32 constant SALT = 0x251543af6a222378665a76fe38dbceae4871a070b7fdaf5c6c30cf } // Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates - function execute(uint8[] sigV, bytes32[] sigR, bytes32[] sigS, address destination, uint value, bytes data, address executor, uint gasLimit) public { + function execute(uint8[] memory sigV, bytes32[] memory sigR, bytes32[] memory sigS, address destination, uint value, bytes memory data, address executor, uint gasLimit) public { require(sigR.length == threshold); require(sigR.length == sigS.length && sigR.length == sigV.length); require(executor == msg.sender || executor == address(0)); @@ -71,5 +72,8 @@ bytes32 constant SALT = 0x251543af6a222378665a76fe38dbceae4871a070b7fdaf5c6c30cf require(success); } - function () payable external {} + event Received(address, uint); + receive() external payable { + emit Received(msg.sender, msg.value); + } }