diff --git a/core/contracts/AcreBitcoinDepositor.sol b/core/contracts/BitcoinDepositor.sol similarity index 98% rename from core/contracts/AcreBitcoinDepositor.sol rename to core/contracts/BitcoinDepositor.sol index 0c1ade254..c0de3cd37 100644 --- a/core/contracts/AcreBitcoinDepositor.sol +++ b/core/contracts/BitcoinDepositor.sol @@ -11,7 +11,7 @@ import "@keep-network/tbtc-v2/contracts/integrator/AbstractTBTCDepositor.sol"; import {stBTC} from "./stBTC.sol"; -/// @title Acre Bitcoin Depositor contract. +/// @title Bitcoin Depositor contract. /// @notice The contract integrates Acre staking with tBTC minting. /// User who wants to stake BTC in Acre should submit a Bitcoin transaction /// to the most recently created off-chain ECDSA wallets of the tBTC Bridge @@ -35,10 +35,7 @@ import {stBTC} from "./stBTC.sol"; /// Depositor address. After tBTC is minted to the Depositor, on the stake /// finalization tBTC is staked in Acre and stBTC shares are emitted /// to the staker. -contract AcreBitcoinDepositor is - AbstractTBTCDepositor, - Ownable2StepUpgradeable -{ +contract BitcoinDepositor is AbstractTBTCDepositor, Ownable2StepUpgradeable { using SafeERC20 for IERC20; /// @notice State of the stake request. @@ -146,7 +143,7 @@ contract AcreBitcoinDepositor is _disableInitializers(); } - /// @notice Acre Bitcoin Depositor contract initializer. + /// @notice Bitcoin Depositor contract initializer. /// @param bridge tBTC Bridge contract instance. /// @param tbtcVault tBTC Vault contract instance. /// @param _tbtcToken tBTC token contract instance. diff --git a/core/contracts/test/AcreBitcoinDepositorHarness.sol b/core/contracts/test/BitcoinDepositorHarness.sol similarity index 96% rename from core/contracts/test/AcreBitcoinDepositorHarness.sol rename to core/contracts/test/BitcoinDepositorHarness.sol index 47f61d9d3..41e8791fc 100644 --- a/core/contracts/test/AcreBitcoinDepositorHarness.sol +++ b/core/contracts/test/BitcoinDepositorHarness.sol @@ -2,7 +2,7 @@ /* solhint-disable func-name-mixedcase */ pragma solidity ^0.8.21; -import {AcreBitcoinDepositor} from "../AcreBitcoinDepositor.sol"; +import {BitcoinDepositor} from "../BitcoinDepositor.sol"; import {MockBridge, MockTBTCVault} from "@keep-network/tbtc-v2/contracts/test/TestTBTCDepositor.sol"; import {IBridge} from "@keep-network/tbtc-v2/contracts/integrator/IBridge.sol"; import {IBridgeTypes} from "@keep-network/tbtc-v2/contracts/integrator/IBridge.sol"; diff --git a/core/contracts/test/upgrades/AcreBitcoinDepositorV2.sol b/core/contracts/test/upgrades/BitcoinDepositorV2.sol similarity index 97% rename from core/contracts/test/upgrades/AcreBitcoinDepositorV2.sol rename to core/contracts/test/upgrades/BitcoinDepositorV2.sol index ad82e9f5b..106629430 100644 --- a/core/contracts/test/upgrades/AcreBitcoinDepositorV2.sol +++ b/core/contracts/test/upgrades/BitcoinDepositorV2.sol @@ -11,14 +11,11 @@ import "@keep-network/tbtc-v2/contracts/integrator/AbstractTBTCDepositor.sol"; import {stBTC} from "../../stBTC.sol"; -/// @title AcreBitcoinDepositorV2 -/// @dev This is a contract used to test Acre Bitcoin Depositor upgradeability. -/// It is a copy of AcreBitcoinDepositor contract with some differences +/// @title BitcoinDepositorV2 +/// @dev This is a contract used to test Bitcoin Depositor upgradeability. +/// It is a copy of BitcoinDepositor contract with some differences /// marked with `TEST:` comments. -contract AcreBitcoinDepositorV2 is - AbstractTBTCDepositor, - Ownable2StepUpgradeable -{ +contract BitcoinDepositorV2 is AbstractTBTCDepositor, Ownable2StepUpgradeable { using SafeERC20 for IERC20; /// @notice State of the stake request. diff --git a/core/deploy/03_deploy_acre_bitcoin_depositor.ts b/core/deploy/03_deploy_bitcoin_depositor.ts similarity index 71% rename from core/deploy/03_deploy_acre_bitcoin_depositor.ts rename to core/deploy/03_deploy_bitcoin_depositor.ts index f2063d5c1..7de26abcb 100644 --- a/core/deploy/03_deploy_acre_bitcoin_depositor.ts +++ b/core/deploy/03_deploy_bitcoin_depositor.ts @@ -12,8 +12,8 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const tbtc = await deployments.get("TBTC") const stbtc = await deployments.get("stBTC") - const [, acreBitcoinDepositorDeployment] = await helpers.upgrades.deployProxy( - "AcreBitcoinDepositor", + const [, deployment] = await helpers.upgrades.deployProxy( + "BitcoinDepositor", { factoryOpts: { signer: deployer, @@ -31,15 +31,9 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { }, ) - if ( - acreBitcoinDepositorDeployment.transactionHash && - hre.network.tags.etherscan - ) { - await waitForTransaction( - hre, - acreBitcoinDepositorDeployment.transactionHash, - ) - await helpers.etherscan.verify(acreBitcoinDepositorDeployment) + if (deployment.transactionHash && hre.network.tags.etherscan) { + await waitForTransaction(hre, deployment.transactionHash) + await helpers.etherscan.verify(deployment) } // TODO: Add Tenderly verification @@ -47,5 +41,5 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { export default func -func.tags = ["AcreBitcoinDepositor"] +func.tags = ["BitcoinDepositor"] func.dependencies = ["TBTC", "stBTC"] diff --git a/core/deploy/23_transfer_ownership_acre_bitcoin_depositor.ts b/core/deploy/23_transfer_ownership_bitcoin_depositor.ts similarity index 73% rename from core/deploy/23_transfer_ownership_acre_bitcoin_depositor.ts rename to core/deploy/23_transfer_ownership_bitcoin_depositor.ts index 30095cd05..b1214346d 100644 --- a/core/deploy/23_transfer_ownership_acre_bitcoin_depositor.ts +++ b/core/deploy/23_transfer_ownership_bitcoin_depositor.ts @@ -6,12 +6,10 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { deployer, governance } = await getNamedAccounts() const { log } = deployments - log( - `transferring ownership of AcreBitcoinDepositor contract to ${governance}`, - ) + log(`transferring ownership of BitcoinDepositor contract to ${governance}`) await deployments.execute( - "AcreBitcoinDepositor", + "BitcoinDepositor", { from: deployer, log: true, waitConfirmations: 1 }, "transferOwnership", governance, @@ -19,7 +17,7 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { if (hre.network.name !== "mainnet") { await deployments.execute( - "AcreBitcoinDepositor", + "BitcoinDepositor", { from: governance, log: true, waitConfirmations: 1 }, "acceptOwnership", ) @@ -28,6 +26,6 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { export default func -func.tags = ["TransferOwnershipAcreBitcoinDepositor"] -func.dependencies = ["AcreBitcoinDepositor"] +func.tags = ["TransferOwnershipBitcoinDepositor"] +func.dependencies = ["BitcoinDepositor"] func.runAtTheEnd = true diff --git a/core/deployments/sepolia/AcreBitcoinDepositor.json b/core/deployments/sepolia/BitcoinDepositor.json similarity index 100% rename from core/deployments/sepolia/AcreBitcoinDepositor.json rename to core/deployments/sepolia/BitcoinDepositor.json diff --git a/core/test/AcreBitcoinDepositor.test.ts b/core/test/BitcoinDepositor.test.ts similarity index 99% rename from core/test/AcreBitcoinDepositor.test.ts rename to core/test/BitcoinDepositor.test.ts index a106d3a92..2c0fd02f7 100644 --- a/core/test/AcreBitcoinDepositor.test.ts +++ b/core/test/BitcoinDepositor.test.ts @@ -12,7 +12,7 @@ import type { StBTC, BridgeStub, TBTCVaultStub, - AcreBitcoinDepositor, + BitcoinDepositor, TestERC20, } from "../typechain" import { deployment } from "./helpers" @@ -30,7 +30,7 @@ async function fixture() { const { lastBlockTime } = helpers.time const { getNamedSigners, getUnnamedSigners } = helpers.signers -describe("AcreBitcoinDepositor", () => { +describe("BitcoinDepositor", () => { const defaultDepositDustThreshold = 1000000 // 1000000 satoshi = 0.01 BTC const defaultDepositTreasuryFeeDivisor = 2000 // 1/2000 = 0.05% = 0.0005 const defaultDepositTxMaxFee = 1000 // 1000 satoshi = 0.00001 BTC @@ -48,7 +48,7 @@ describe("AcreBitcoinDepositor", () => { const depositorFee = to1ePrecision(10, 10) // 10 satoshi const amountToStake = to1ePrecision(896501, 8) // 8965,01 satoshi - let bitcoinDepositor: AcreBitcoinDepositor + let bitcoinDepositor: BitcoinDepositor let tbtcBridge: BridgeStub let tbtcVault: TBTCVaultStub let stbtc: StBTC diff --git a/core/test/AcreBitcoinDepositor.upgrade.test.ts b/core/test/BitcoinDepositor.upgrade.test.ts similarity index 90% rename from core/test/AcreBitcoinDepositor.upgrade.test.ts rename to core/test/BitcoinDepositor.upgrade.test.ts index c447c74ce..46ea0155c 100644 --- a/core/test/AcreBitcoinDepositor.upgrade.test.ts +++ b/core/test/BitcoinDepositor.upgrade.test.ts @@ -8,10 +8,10 @@ import { beforeAfterSnapshotWrapper, deployment } from "./helpers" import { TestERC20, StBTC, - AcreBitcoinDepositor, + BitcoinDepositor, BridgeStub, TBTCVaultStub, - AcreBitcoinDepositorV2, + BitcoinDepositorV2, } from "../typechain" import { to1e18 } from "./utils" @@ -24,12 +24,12 @@ async function fixture() { return { tbtc, stbtc, bitcoinDepositor, tbtcBridge, tbtcVault } } -describe("AcreBitcoinDepositor contract upgrade", () => { +describe("BitcoinDepositor contract upgrade", () => { let tbtc: TestERC20 let tbtcBridge: BridgeStub let tbtcVault: TBTCVaultStub let stbtc: StBTC - let bitcoinDepositor: AcreBitcoinDepositor + let bitcoinDepositor: BitcoinDepositor let governance: HardhatEthersSigner before(async () => { @@ -40,7 +40,7 @@ describe("AcreBitcoinDepositor contract upgrade", () => { context("when upgrading to a valid contract", () => { const newVariable = 1n - let bitcoinDepositorV2: AcreBitcoinDepositorV2 + let bitcoinDepositorV2: BitcoinDepositorV2 let v1InitialParameters: { minStakeAmount: bigint depositorFeeDivisor: bigint @@ -59,8 +59,8 @@ describe("AcreBitcoinDepositor contract upgrade", () => { } const [upgradedDepositor] = await helpers.upgrades.upgradeProxy( - "AcreBitcoinDepositor", - "AcreBitcoinDepositorV2", + "BitcoinDepositor", + "BitcoinDepositorV2", { factoryOpts: { signer: governance }, proxyOpts: { @@ -72,8 +72,7 @@ describe("AcreBitcoinDepositor contract upgrade", () => { }, ) - bitcoinDepositorV2 = - upgradedDepositor as unknown as AcreBitcoinDepositorV2 + bitcoinDepositorV2 = upgradedDepositor as unknown as BitcoinDepositorV2 }) it("new instance should have the same address as the old one", async () => { diff --git a/core/test/helpers/context.ts b/core/test/helpers/context.ts index 3933baeb1..03c495666 100644 --- a/core/test/helpers/context.ts +++ b/core/test/helpers/context.ts @@ -8,7 +8,7 @@ import type { BridgeStub, TestERC4626, TBTCVaultStub, - AcreBitcoinDepositor, + BitcoinDepositor, } from "../../typechain" // eslint-disable-next-line import/prefer-default-export @@ -16,9 +16,8 @@ export async function deployment() { await deployments.fixture() const stbtc: stBTC = await getDeployedContract("stBTC") - const bitcoinDepositor: AcreBitcoinDepositor = await getDeployedContract( - "AcreBitcoinDepositor", - ) + const bitcoinDepositor: BitcoinDepositor = + await getDeployedContract("BitcoinDepositor") const tbtc: TestERC20 = await getDeployedContract("TBTC") const tbtcBridge: BridgeStub = await getDeployedContract("Bridge") diff --git a/sdk/src/lib/contracts/bitcoin-depositor.ts b/sdk/src/lib/contracts/bitcoin-depositor.ts index 960bc4e1f..749f78b73 100644 --- a/sdk/src/lib/contracts/bitcoin-depositor.ts +++ b/sdk/src/lib/contracts/bitcoin-depositor.ts @@ -10,7 +10,7 @@ export type DecodedExtraData = { } /** - * Interface for communication with the AcreBitcoinDepositor on-chain contract. + * Interface for communication with the BitcoinDepositor on-chain contract. */ export interface BitcoinDepositor extends DepositorProxy { /** diff --git a/sdk/src/lib/ethereum/artifacts/sepolia/AcreBitcoinDepositor.json b/sdk/src/lib/ethereum/artifacts/sepolia/BitcoinDepositor.json similarity index 100% rename from sdk/src/lib/ethereum/artifacts/sepolia/AcreBitcoinDepositor.json rename to sdk/src/lib/ethereum/artifacts/sepolia/BitcoinDepositor.json diff --git a/sdk/src/lib/ethereum/bitcoin-depositor.ts b/sdk/src/lib/ethereum/bitcoin-depositor.ts index e5b33ca80..d968ee5b6 100644 --- a/sdk/src/lib/ethereum/bitcoin-depositor.ts +++ b/sdk/src/lib/ethereum/bitcoin-depositor.ts @@ -1,5 +1,5 @@ import { packRevealDepositParameters } from "@keep-network/tbtc-v2.ts" -import { AcreBitcoinDepositor as AcreBitcoinDepositorTypechain } from "@acre-btc/core/typechain/contracts/AcreBitcoinDepositor" +import { BitcoinDepositor as BitcoinDepositorTypechain } from "@acre-btc/core/typechain/contracts/BitcoinDepositor" import { ZeroAddress, dataSlice, @@ -24,7 +24,7 @@ import { import { Hex } from "../utils" import { EthereumNetwork } from "./network" -import SepoliaBitcoinDepositor from "./artifacts/sepolia/AcreBitcoinDepositor.json" +import SepoliaBitcoinDepositor from "./artifacts/sepolia/BitcoinDepositor.json" /** * Ethereum implementation of the BitcoinDepositor. @@ -32,8 +32,8 @@ import SepoliaBitcoinDepositor from "./artifacts/sepolia/AcreBitcoinDepositor.js class EthereumBitcoinDepositor // @ts-expect-error TODO: Figure out why type generated by typechain does not // satisfy the constraint `Contract`. Error: `Property '[internal]' is missing - // in type 'AcreBitcoinDepositor' but required in type 'Contract'`. - extends EthersContractWrapper + // in type 'BitcoinDepositor' but required in type 'Contract'`. + extends EthersContractWrapper implements BitcoinDepositor { constructor(config: EthersContractConfig, network: EthereumNetwork) { diff --git a/sdk/src/modules/staking/stake-initialization.ts b/sdk/src/modules/staking/stake-initialization.ts index 4d66a111c..869de4452 100644 --- a/sdk/src/modules/staking/stake-initialization.ts +++ b/sdk/src/modules/staking/stake-initialization.ts @@ -120,7 +120,7 @@ class StakeInitialization { */ #getStakeMessageTypedData() { const domain: Domain = { - name: "AcreBitcoinDepositor", + name: "BitcoinDepositor", version: "1", verifyingContract: this.#contracts.bitcoinDepositor.getChainIdentifier(), } diff --git a/sdk/test/lib/ethereum/eip712.test.ts b/sdk/test/lib/ethereum/eip712.test.ts index 5e342e0ac..7395d8497 100644 --- a/sdk/test/lib/ethereum/eip712.test.ts +++ b/sdk/test/lib/ethereum/eip712.test.ts @@ -7,7 +7,7 @@ import { const signMessageData = { domain: { - name: "AcreBitcoinDepositor", + name: "BitcoinDepositor", version: "1", verifyingContract: EthereumAddress.from( ethers.Wallet.createRandom().address, diff --git a/sdk/test/modules/staking.test.ts b/sdk/test/modules/staking.test.ts index 664e54767..6eaca2ead 100644 --- a/sdk/test/modules/staking.test.ts +++ b/sdk/test/modules/staking.test.ts @@ -171,7 +171,7 @@ describe("Staking", () => { it("should sign message", () => { expect(messageSigner.sign).toHaveBeenCalledWith( { - name: "AcreBitcoinDepositor", + name: "BitcoinDepositor", version: "1", verifyingContract: contracts.bitcoinDepositor.getChainIdentifier(),