diff --git a/fvm/evm/stdlib/contract.go b/fvm/evm/stdlib/contract.go index 210c9664f38..74ea2c5dfb4 100644 --- a/fvm/evm/stdlib/contract.go +++ b/fvm/evm/stdlib/contract.go @@ -178,11 +178,30 @@ var InternalEVMTypeDryRunFunctionType = &sema.FunctionType{ ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.AnyStructType), } -// InternalEVM.dryCall +// InternalEVM.batchRun -const InternalEVMTypeDryCallFunctionName = "dryCall" +const InternalEVMTypeBatchRunFunctionName = "batchRun" -var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{ +var InternalEVMTypeBatchRunFunctionType *sema.FunctionType = &sema.FunctionType{ + Parameters: []sema.Parameter{ + { + Label: "txs", + TypeAnnotation: sema.NewTypeAnnotation(EVMTransactionsBatchBytesType), + }, + { + Label: "coinbase", + TypeAnnotation: sema.NewTypeAnnotation(EVMAddressBytesType), + }, + }, + // Actually [EVM.Result], but cannot refer to it here + ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.NewVariableSizedType(nil, sema.AnyStructType)), +} + +// InternalEVM.call + +const InternalEVMTypeCallFunctionName = "call" + +var InternalEVMTypeCallFunctionType = &sema.FunctionType{ Parameters: []sema.Parameter{ { Label: "from", @@ -209,30 +228,11 @@ var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{ ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.AnyStructType), } -// InternalEVM.batchRun - -const InternalEVMTypeBatchRunFunctionName = "batchRun" - -var InternalEVMTypeBatchRunFunctionType *sema.FunctionType = &sema.FunctionType{ - Parameters: []sema.Parameter{ - { - Label: "txs", - TypeAnnotation: sema.NewTypeAnnotation(EVMTransactionsBatchBytesType), - }, - { - Label: "coinbase", - TypeAnnotation: sema.NewTypeAnnotation(EVMAddressBytesType), - }, - }, - // Actually [EVM.Result], but cannot refer to it here - ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.NewVariableSizedType(nil, sema.AnyStructType)), -} - -// InternalEVM.call +// InternalEVM.dryCall -const InternalEVMTypeCallFunctionName = "call" +const InternalEVMTypeDryCallFunctionName = "dryCall" -var InternalEVMTypeCallFunctionType = &sema.FunctionType{ +var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{ Parameters: []sema.Parameter{ { Label: "from", @@ -465,12 +465,6 @@ var InternalEVMContractType = func() *sema.CompositeType { InternalEVMTypeDryRunFunctionType, "", ), - sema.NewUnmeteredPublicFunctionMember( - ty, - InternalEVMTypeDryCallFunctionName, - InternalEVMTypeDryCallFunctionType, - "", - ), sema.NewUnmeteredPublicFunctionMember( ty, InternalEVMTypeBatchRunFunctionName, @@ -489,6 +483,12 @@ var InternalEVMContractType = func() *sema.CompositeType { InternalEVMTypeCallFunctionType, "", ), + sema.NewUnmeteredPublicFunctionMember( + ty, + InternalEVMTypeDryCallFunctionName, + InternalEVMTypeDryCallFunctionType, + "", + ), sema.NewUnmeteredPublicFunctionMember( ty, InternalEVMTypeDepositFunctionName,