Skip to content

Commit

Permalink
harmony-one#99 reduced OneBTC Contract size from 24KB to 21KB
Browse files Browse the repository at this point in the history
  • Loading branch information
hashmesan committed Apr 25, 2022
1 parent 267a224 commit 2457ed7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion contract/bridge/scripts/deploy_onebtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ async function main() {
process.env.HMY_RELAY_CONTRACT
);

const OneBtc = await ethers.getContractFactory("OneBtc");
const BtcLib = await ethers.getContractFactory("Secp256k1");
const btcLib = await BtcLib.deploy();
const OneBtc = await ethers.getContractFactory("OneBtc", {libraries: {"Secp256k1": btcLib.address}});
const oneBtc = await OneBtc.deploy();
await oneBtc.initialize(relay.address);

Expand Down
2 changes: 1 addition & 1 deletion contract/bridge/test/OneBTC.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract("issue/redeem test", accounts => {
before(async function() {
this.RelayMock = await RelayMock.new();
this.ExchangeRateOracleWrapper = await deployProxy(ExchangeRateOracleWrapper);
this.OneBtc = await deployProxy(OneBtc, [this.RelayMock.address, this.ExchangeRateOracleWrapper.address]);
this.OneBtc = await deployProxy(OneBtc, [this.RelayMock.address, this.ExchangeRateOracleWrapper.address],{initializer: false, unsafeAllowLinkedLibraries: true});

// set BTC/ONE exchange rate
await this.ExchangeRateOracleWrapper.setExchangeRate(10); // 1 OneBtc = 10 ONE
Expand Down

0 comments on commit 2457ed7

Please sign in to comment.