diff --git a/.circleci/config.yml b/.circleci/config.yml index 1147ba5b1..89b3e4d73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -298,25 +298,25 @@ workflows: context: keep-dev requires: - setup_github_package_registry -# - build_initcontainer: -# filters: -# branches: -# only: master -# context: keep-dev -# requires: -# - migrate_contracts -# - publish_images: -# filters: -# branches: -# only: master -# context: keep-dev -# requires: -# - migrate_contracts -# - build_initcontainer -# - publish_contract_data: -# filters: -# branches: -# only: master -# context: keep-dev -# requires: -# - migrate_contracts + - build_initcontainer: + filters: + branches: + only: master + context: keep-dev + requires: + - migrate_contracts + - publish_images: + filters: + branches: + only: master + context: keep-dev + requires: + - migrate_contracts + - build_initcontainer + - publish_contract_data: + filters: + branches: + only: master + context: keep-dev + requires: + - migrate_contracts diff --git a/implementation/contracts/deposit/DepositRedemption.sol b/implementation/contracts/deposit/DepositRedemption.sol index 53eb59f18..2b29b7c00 100644 --- a/implementation/contracts/deposit/DepositRedemption.sol +++ b/implementation/contracts/deposit/DepositRedemption.sol @@ -6,7 +6,6 @@ import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol"; import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol"; import {CheckBitcoinSigs} from "@summa-tx/bitcoin-spv-sol/contracts/CheckBitcoinSigs.sol"; import {DepositUtils} from "./DepositUtils.sol"; -import {IBondedECDSAKeep} from "../external/IBondedECDSAKeep.sol"; import {IECDSAKeep} from "@keep-network/keep-ecdsa/contracts/api/IECDSAKeep.sol"; import {DepositStates} from "./DepositStates.sol"; import {OutsourceDepositLogging} from "./OutsourceDepositLogging.sol"; @@ -34,10 +33,10 @@ library DepositRedemption { address _tbtcTokenAddress = _d.TBTCToken; TBTCToken _tbtcToken = TBTCToken(_tbtcTokenAddress); - IBondedECDSAKeep _keep = IBondedECDSAKeep(_d.keepAddress); + IECDSAKeep _keep = IECDSAKeep(_d.keepAddress); _tbtcToken.approve(_d.keepAddress, DepositUtils.signerFee()); - _keep.distributeERC20ToKeepGroup(_d.keepAddress, _tbtcTokenAddress, DepositUtils.signerFee()); + _keep.distributeERC20ToMembers(_tbtcTokenAddress, DepositUtils.signerFee()); } /// @notice Approves digest for signing by a keep diff --git a/implementation/contracts/deposit/DepositUtils.sol b/implementation/contracts/deposit/DepositUtils.sol index b6b963e6c..4d082362d 100644 --- a/implementation/contracts/deposit/DepositUtils.sol +++ b/implementation/contracts/deposit/DepositUtils.sol @@ -7,6 +7,7 @@ import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol"; import {TBTCConstants} from "./TBTCConstants.sol"; import {ITBTCSystem} from "../interfaces/ITBTCSystem.sol"; import {IERC721} from "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; +import {IECDSAKeep} from "@keep-network/keep-ecdsa/contracts/api/IECDSAKeep.sol"; import {IBondedECDSAKeep} from "../external/IBondedECDSAKeep.sol"; import {TBTCToken} from "../system/TBTCToken.sol"; @@ -379,7 +380,8 @@ library DepositUtils { /// @return true if successful, otherwise revert function pushFundsToKeepGroup(Deposit storage _d, uint256 _ethValue) public returns (bool) { require(address(this).balance >= _ethValue, "Not enough funds to send"); - IBondedECDSAKeep _keep = IBondedECDSAKeep(_d.keepAddress); - return _keep.distributeEthToKeepGroup.value(_ethValue)(_d.keepAddress); + IECDSAKeep _keep = IECDSAKeep(_d.keepAddress); + _keep.distributeETHToMembers.value(_ethValue)(); + return true; } } diff --git a/implementation/contracts/external/IBondedECDSAKeep.sol b/implementation/contracts/external/IBondedECDSAKeep.sol index 0f3494cc6..9e063d82c 100644 --- a/implementation/contracts/external/IBondedECDSAKeep.sol +++ b/implementation/contracts/external/IBondedECDSAKeep.sol @@ -16,15 +16,6 @@ interface IBondedECDSAKeep { bytes calldata _preimage ) external returns (bool _isFraud); - // Allow sending funds to a keep group - // Expected: increment their existing ETH bond - function distributeEthToKeepGroup(address _keepAddress) external payable returns (bool); - - // Allow sending tokens to a keep group - // Useful for sending signers their TBTC - // The Keep contract should call transferFrom on the token contract - function distributeERC20ToKeepGroup(address _keepAddress, address _asset, uint256 _value) external returns (bool); - // returns the amount of the keep's ETH bond in wei function checkBondAmount(address _keepAddress) external view returns (uint256); diff --git a/implementation/package-lock.json b/implementation/package-lock.json index 6279dfe8e..e7b318f04 100644 --- a/implementation/package-lock.json +++ b/implementation/package-lock.json @@ -53,9 +53,9 @@ } }, "@keep-network/keep-ecdsa": { - "version": "0.1.1", - "resolved": "https://npm.pkg.github.com/download/@keep-network/keep-ecdsa/0.1.1/4c4c014425154c0796446e21ef8950218200a7d684e1917c377916dc7b279d48", - "integrity": "sha1-83KUz+8FNQc/YZMIJRL/bCMNANU=", + "version": "0.1.2", + "resolved": "https://npm.pkg.github.com/download/@keep-network/keep-ecdsa/0.1.2/2ec5def4b97bcb87dd3378edddfa01233151274380b6b299659b1ecd0fea5068", + "integrity": "sha512-MqXRjmcb1b7gSSoz1ZiMfyX0Ig8RbLnWUx+Qnw1NXv/WxwJXYJuKYihNBImKKGcUCq9KmMl3oXWOogVLruJ79A==", "requires": { "openzeppelin-solidity": "^2.3.0" } diff --git a/implementation/package.json b/implementation/package.json index 419853960..bdf035748 100644 --- a/implementation/package.json +++ b/implementation/package.json @@ -21,7 +21,7 @@ "author": "James Prestwich", "license": "UNLICENSED", "dependencies": { - "@keep-network/keep-ecdsa": "^0.1.1", + "@keep-network/keep-ecdsa": "^0.1.2", "bn-chai": "^1.0.1", "bn.js": "^4.11.8", "@summa-tx/bitcoin-spv-sol": "^2.1.0", diff --git a/implementation/scripts/circleci-migrate-contracts.sh b/implementation/scripts/circleci-migrate-contracts.sh index f68344874..082d0ff74 100755 --- a/implementation/scripts/circleci-migrate-contracts.sh +++ b/implementation/scripts/circleci-migrate-contracts.sh @@ -55,7 +55,7 @@ ssh utilitybox << EOF cd /tmp/$BUILD_TAG/implementation # TODO: Migrations fail with truffle version specified in package.json file. That's why we install dependencies manually here, bug: https://github.com/keep-network/tbtc/issues/231 -npm install @keep-network/keep-ecdsa@0.1.1 +npm install @keep-network/keep-ecdsa@0.1.2 npm install @summa-tx/bitcoin-spv-sol@2.1.0 npm install bn-chai@1.0.1 npm install bn.js@4.11.8 diff --git a/implementation/test/contracts/keep/ECDSAKeepStub.sol b/implementation/test/contracts/keep/ECDSAKeepStub.sol index 92f16937f..0a5ce7946 100644 --- a/implementation/test/contracts/keep/ECDSAKeepStub.sol +++ b/implementation/test/contracts/keep/ECDSAKeepStub.sol @@ -46,6 +46,15 @@ contract ECDSAKeepStub is IECDSAKeep, IBondedECDSAKeep { emit SignatureRequested(_digest); } + function distributeETHToMembers() external payable { + + } + + function distributeERC20ToMembers(address _asset, uint256 _value) external { + + } + + // Functions implemented for IBondedECDSAKeep interface. function submitSignatureFraud( @@ -59,14 +68,6 @@ contract ECDSAKeepStub is IECDSAKeep, IBondedECDSAKeep { return success; } - function distributeEthToKeepGroup(address _keepAddress) external payable returns (bool){ - return success; - } - - function distributeERC20ToKeepGroup(address _keepAddress, address _asset, uint256 _value) external returns (bool){ - return success; - } - function checkBondAmount(address _keepAddress) external view returns (uint256){ return bondAmount; }