-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC 12 Implementation: On-chain proposal validation (#756)
Refs: #737 Here we present the fifth part of the changes meant to implement [RFC 12: Decentralized wallet coordination](https://github.com/keep-network/tbtc-v2/blob/main/docs/rfc/rfc-12.adoc) in the tBTC wallet client. This pull request focuses on the on-chain proposal validation, i.e. the `WalletProposalValidator` contract described in RFC 12. ### The `WalletProposalValidator` contract Here we introduce the read-only, non-upgradeable, `WalletProposalValidator` contract that allows validating wallet action proposals. This contract exposes three functions: - `validateDepositSweepProposal` that allows validating deposit sweep proposals. This function was ported from the `WalletCoordinator` contract. - `validateRedemptionProposal` that allows validating redemption proposals. This function was ported from the `WalletCoordinator` contract. - `validateHeartbeatProposal` that allows validating heartbeat proposals. ### Remove `WalletCoordinator` contract We are also removing the `WalletCoordinator` contract. It is no longer needed with the new RFC-12-based coordination mechanism. The relevant view validation functions were ported to the aforementioned `WalletProposalValidator` contract. By the way, we are also adjusting the deployment scripts to reflect contract changes made in this PR. ### Next steps The next steps on the way towards RFC 12 implementation are: - Integrate `WalletProposalValidator` contract with the client and cleanup `WalletCoordinator` leftovers there - Modify the SPV maintainer to not rely on `WalletCoordinator`'s events during unproven transactions lookup
- Loading branch information
Showing
13 changed files
with
166 additions
and
1,948 deletions.
There are no files selected for viewing
503 changes: 55 additions & 448 deletions
503
...ty/contracts/bridge/WalletCoordinator.sol → ...tracts/bridge/WalletProposalValidator.sol
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions
19
solidity/deploy/36_transfer_wallet_coordinator_ownership.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { HardhatRuntimeEnvironment } from "hardhat/types" | ||
import { DeployFunction } from "hardhat-deploy/types" | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployments, helpers, getNamedAccounts } = hre | ||
const { deploy } = deployments | ||
const { deployer } = await getNamedAccounts() | ||
|
||
const Bridge = await deployments.get("Bridge") | ||
|
||
const walletProposalValidator = await deploy("WalletProposalValidator", { | ||
from: deployer, | ||
args: [Bridge.address], | ||
log: true, | ||
waitConfirmations: 1, | ||
}) | ||
|
||
if (hre.network.tags.etherscan) { | ||
await helpers.etherscan.verify(walletProposalValidator) | ||
} | ||
|
||
if (hre.network.tags.tenderly) { | ||
await hre.tenderly.verify({ | ||
name: "WalletProposalValidator", | ||
address: walletProposalValidator.address, | ||
}) | ||
} | ||
} | ||
|
||
export default func | ||
|
||
func.tags = ["WalletProposalValidator"] | ||
func.dependencies = ["Bridge"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.