forked from harmony-one/onebtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
harmony-one#99 all tests passed: ensure contracts deploy with linked …
…libraries
- Loading branch information
hashmesan
committed
Apr 25, 2022
1 parent
2457ed7
commit f40af1a
Showing
8 changed files
with
49 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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,27 @@ | ||
|
||
const { deployProxy } = require("@openzeppelin/truffle-upgrades"); | ||
|
||
const OneBtc = artifacts.require("OneBtc"); | ||
const RelayMock = artifacts.require("RelayMock"); | ||
const ExchangeRateOracleWrapper = artifacts.require("ExchangeRateOracleWrapper"); | ||
const Secp256k1 = artifacts.require("Secp256k1"); | ||
const TxValidate = artifacts.require("TxValidate"); | ||
|
||
async function deployOneBTC() { | ||
const relayMock = await RelayMock.new(); | ||
const exchangeRateOracleWrapper = await deployProxy(ExchangeRateOracleWrapper); | ||
|
||
const Secp256k1Lib = await Secp256k1.new(); | ||
OneBtc.link("Secp256k1", Secp256k1Lib.address); | ||
|
||
const TxValidateLib = await TxValidate.new(); | ||
OneBtc.link("TxValidate", TxValidateLib.address); | ||
|
||
const oneBtc = await deployProxy(OneBtc, [RelayMock.address, ExchangeRateOracleWrapper.address],{unsafeAllowLinkedLibraries: true}); | ||
|
||
return {oneBtc, relayMock, exchangeRateOracleWrapper} | ||
} | ||
|
||
module.exports = { | ||
deployOneBTC | ||
} |