diff --git a/fvm/bootstrap.go b/fvm/bootstrap.go index a37d0948461..a3a8f787d31 100644 --- a/fvm/bootstrap.go +++ b/fvm/bootstrap.go @@ -396,6 +396,8 @@ func (b *bootstrapExecutor) Execute() error { b.mintInitialTokens(service, fungibleToken, flowToken, b.initialTokenSupply) } + b.deployExecutionParameters(fungibleToken, &env) + b.setupExecutionWeights(fungibleToken) b.deployServiceAccount(service, &env) b.setupParameters( @@ -416,8 +418,6 @@ func (b *bootstrapExecutor) Execute() error { b.setContractDeploymentRestrictions(service, b.restrictedContractDeployment) - b.setupExecutionWeights(service) - b.setupStorageForServiceAccounts(service, fungibleToken, flowToken, feeContract) b.createMinter(service, flowToken) @@ -723,6 +723,19 @@ func (b *bootstrapExecutor) deployEpoch(deployTo flow.Address, env *templates.En panicOnMetaInvokeErrf("failed to deploy Epoch contract: %s", txError, err) } +func (b *bootstrapExecutor) deployExecutionParameters(deployTo flow.Address, env *templates.Environment) { + contract := contracts.FlowExecutionParameters(*env) + txError, err := b.invokeMetaTransaction( + b.ctx, + Transaction( + blueprints.DeployContractTransaction(deployTo, contract, "FlowExecutionParameters"), + 0, + ), + ) + env.FlowExecutionParametersAddress = deployTo.String() + panicOnMetaInvokeErrf("failed to deploy FlowExecutionParameters contract: %s", txError, err) +} + func (b *bootstrapExecutor) deployServiceAccount(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowServiceAccount( *env, diff --git a/go.mod b/go.mod index c8971c27bc8..e28a391921e 100644 --- a/go.mod +++ b/go.mod @@ -51,8 +51,8 @@ require ( github.com/onflow/cadence v1.3.1 github.com/onflow/crypto v0.25.2 github.com/onflow/flow v0.3.4 - github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 - github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0 + github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.0 + github.com/onflow/flow-core-contracts/lib/go/templates v1.5.0 github.com/onflow/flow-go-sdk v1.3.1 github.com/onflow/flow/protobuf/go/flow v0.4.7 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 diff --git a/go.sum b/go.sum index d80e0e5bbaf..9d113d84de5 100644 --- a/go.sum +++ b/go.sum @@ -916,8 +916,14 @@ github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE= github.com/onflow/flow v0.3.4/go.mod h1:lzyAYmbu1HfkZ9cfnL5/sjrrsnJiUU8fRL26CqLP7+c= github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 h1:R86HaOuk6vpuECZnriEUE7bw9inC2AtdSn8lL/iwQLQ= github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0/go.mod h1:9asTBnB6Tw2UlVVtQKyS/egYv3xr4zVlJnJ75z1dfac= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.0 h1:uyW2VRp8RTeCJRIOcaW/HbzbVF3VsnCmf0lzfN1Lw9Y= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.0/go.mod h1:0/Fd2+5yjAp6Vo9cJxHMxNBxElhtX35H1RvTI6Gpbps= github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0 h1:u2DAG8pk0xFH7TwS70t1gSZ/FtIIZWMSNyiu4SeXBYg= github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64= +github.com/onflow/flow-core-contracts/lib/go/templates v1.4.1-0.20250121150329-3add9787ef8b h1:MkopKmomIfTd6HxlXygcF0SDEen/RxTfR9ihjiGsak4= +github.com/onflow/flow-core-contracts/lib/go/templates v1.4.1-0.20250121150329-3add9787ef8b/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64= +github.com/onflow/flow-core-contracts/lib/go/templates v1.5.0 h1:foKXHHzPxiwLg/2S+FYsmIHRDe0TbkJF+Zb5NSYg/lE= +github.com/onflow/flow-core-contracts/lib/go/templates v1.5.0/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64= github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24= github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=