Skip to content

Commit de8f91a

Browse files
committed
Update to Functions Contracts v1.3.0
1 parent 957b2d2 commit de8f91a

File tree

6 files changed

+563
-112
lines changed

6 files changed

+563
-112
lines changed

src/localFunctionsTestnet.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
simulatedSecretsKeys,
1515
DEFAULT_MAX_ON_CHAIN_RESPONSE_BYTES,
1616
numberOfSimulatedNodeExecutions,
17+
simulatedLinkUsdPrice,
1718
} from './simulationConfig'
1819
import {
1920
LinkTokenSource,
@@ -367,9 +368,12 @@ export const deployFunctionsOracle = async (deployer: Wallet): Promise<Functions
367368
MockV3AggregatorSource.bytecode,
368369
deployer,
369370
)
370-
const linkPriceFeed = await linkPriceFeedFactory
371+
const linkEthPriceFeed = await linkPriceFeedFactory
371372
.connect(deployer)
372373
.deploy(18, simulatedLinkEthPrice)
374+
const linkUsdPriceFeed = await linkPriceFeedFactory
375+
.connect(deployer)
376+
.deploy(8, simulatedLinkUsdPrice)
373377

374378
const routerFactory = new ContractFactory(
375379
FunctionsRouterSource.abi,
@@ -387,14 +391,21 @@ export const deployFunctionsOracle = async (deployer: Wallet): Promise<Functions
387391
)
388392
const mockCoordinator = await mockCoordinatorFactory
389393
.connect(deployer)
390-
.deploy(router.address, simulatedCoordinatorConfig, linkPriceFeed.address)
394+
.deploy(
395+
router.address,
396+
simulatedCoordinatorConfig,
397+
linkEthPriceFeed.address,
398+
linkUsdPriceFeed.address,
399+
)
391400

392401
const allowlistFactory = new ContractFactory(
393402
TermsOfServiceAllowListSource.abi,
394403
TermsOfServiceAllowListSource.bytecode,
395404
deployer,
396405
)
397-
const allowlist = await allowlistFactory.connect(deployer).deploy(simulatedAllowListConfig)
406+
const initialAllowedSenders: string[] = []
407+
const initialBlockedSenders: string[] = []
408+
const allowlist = await allowlistFactory.connect(deployer).deploy(simulatedAllowListConfig, initialAllowedSenders, initialBlockedSenders)
398409

399410
const setAllowListIdTx = await router.setAllowListId(
400411
utils.formatBytes32String(simulatedAllowListId),

src/simulationConfig.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const simulatedLinkEthPrice = BigInt('1000000000000000')
1+
export const simulatedLinkEthPrice = BigInt('6000000000000000')
2+
export const simulatedLinkUsdPrice = BigInt('1500000000')
23

34
export const simulatedDonId = 'local-functions-testnet'
45

@@ -20,10 +21,14 @@ export const simulatedCoordinatorConfig = {
2021
gasOverheadBeforeCallback: 44_615,
2122
gasOverheadAfterCallback: 44_615,
2223
requestTimeoutSeconds: 0, // 300 is used on actual mainnet & testnet blockchains
23-
donFee: 0,
24+
donFeeCentsUsd: 0,
2425
maxSupportedRequestDataVersion: 1,
2526
fulfillmentGasPriceOverEstimationBP: 0,
2627
fallbackNativePerUnitLink: BigInt('5000000000000000'),
28+
minimumEstimateGasPriceWei: 1000000000, // 1 gwei
29+
fallbackUsdPerUnitLink: 1400000000,
30+
fallbackUsdPerUnitLinkDecimals: 8,
31+
operationFeeCentsUsd: 0,
2732
}
2833

2934
export const simulatedAllowListConfig = {

0 commit comments

Comments
 (0)