Skip to content

Commit

Permalink
PKG -- [fcl-core] Add previewnet FCLCrypto address
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Mar 4, 2024
1 parent 123800e commit ecb31ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-roses-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl-core": minor
---

Add previewnet FCLCrypto address
18 changes: 8 additions & 10 deletions packages/fcl-core/src/app-utils/verify-signatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,18 @@ const getVerifySignaturesScript = async (sig, opts) => {

let network = await getChainId(opts)

let fclCryptoContract
const contractAddresses = {
testnet: "0x74daa6f9c7ef24b1",
mainnet: "0xb4b82a1c9d21d284",
previewnet: "0x40b5b8b2ce81ea4a",
}
const fclCryptoContract = opts.fclCryptoContract || contractAddresses[network]

invariant(
opts.fclCryptoContract || network === "testnet" || network === "mainnet",
"${verifyFunction}({ fclCryptoContract }) -- fclCrypto contract address must be set for non-mainnet/testnet networks"
fclCryptoContract,
`${verifyFunction}({ fclCryptoContract }) -- FCLCrypto contract address is unknown for network: ${network}. Please manually specify the FCLCrypto contract address.`
)

if (opts.fclCryptoContract) {
fclCryptoContract = opts.fclCryptoContract
} else {
fclCryptoContract =
network === "testnet" ? "0x74daa6f9c7ef24b1" : "0xb4b82a1c9d21d284"
}

return `
import FCLCrypto from ${fclCryptoContract}
Expand Down

0 comments on commit ecb31ff

Please sign in to comment.