diff --git a/cmd/util/cmd/common/transactions.go b/cmd/util/cmd/common/transactions.go index 066561ef378..00952749e36 100644 --- a/cmd/util/cmd/common/transactions.go +++ b/cmd/util/cmd/common/transactions.go @@ -11,7 +11,7 @@ import ( const ( getInfoForProposedNodesScript = ` - import FlowIDTableStaking from 0xIDENTITYTABLEADDRESS + import FlowIDTableStaking from "FlowIDTableStaking" access(all) fun main(): [FlowIDTableStaking.NodeInfo] { let nodeIDs = FlowIDTableStaking.getProposedNodeIDs() diff --git a/cmd/util/cmd/epochs/cmd/deploy.go b/cmd/util/cmd/epochs/cmd/deploy.go index d8340b29e84..d90cd210dd9 100644 --- a/cmd/util/cmd/epochs/cmd/deploy.go +++ b/cmd/util/cmd/epochs/cmd/deploy.go @@ -256,14 +256,15 @@ func getDeployEpochTransactionText(snapshot *inmem.Snapshot) []byte { chainID := head.ChainID systemContracts := systemcontracts.SystemContractsForChain(chainID) + env := systemContracts.AsTemplateEnv() + env.FungibleTokenAddress = flagFungibleTokenAddress + env.FlowTokenAddress = flagFlowTokenAddress + env.IDTableAddress = flagIDTableAddress + env.FlowFeesAddress = flagFlowFeesAddress + // epoch contract name and get code for contract epochContractCode := contracts.FlowEpoch( - flagFungibleTokenAddress, - flagFlowTokenAddress, - flagIDTableAddress, - systemContracts.ClusterQC.Address.Hex(), - systemContracts.DKG.Address.Hex(), - flagFlowFeesAddress, + env, ) // convert the epoch contract code to an [UInt8] literal string that can be diff --git a/cmd/util/ledger/migrations/change_contract_code_migration.go b/cmd/util/ledger/migrations/change_contract_code_migration.go index eadfa65113d..3408fbc1248 100644 --- a/cmd/util/ledger/migrations/change_contract_code_migration.go +++ b/cmd/util/ledger/migrations/change_contract_code_migration.go @@ -3,13 +3,8 @@ package migrations import ( "fmt" - coreContracts "github.com/onflow/flow-core-contracts/lib/go/contracts" - ftContracts "github.com/onflow/flow-ft/lib/go/contracts" - nftContracts "github.com/onflow/flow-nft/lib/go/contracts" - - sdk "github.com/onflow/flow-go-sdk" - "github.com/onflow/cadence/runtime/common" + coreContracts "github.com/onflow/flow-core-contracts/lib/go/contracts" evm "github.com/onflow/flow-go/fvm/evm/stdlib" "github.com/onflow/flow-go/fvm/systemcontracts" @@ -77,64 +72,40 @@ func BurnerAddressForChain(chainID flow.ChainID) flow.Address { func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOptions) []StagedContract { systemContracts := systemcontracts.SystemContractsForChain(chainID) - serviceAccountAddress := systemContracts.FlowServiceAccount.Address - idTableStakingAddress := systemContracts.IDTableStaking.Address - clusterQCAddress := systemContracts.ClusterQC.Address - dkgAddress := systemContracts.DKG.Address - fungibleTokenAddress := systemContracts.FungibleToken.Address - flowTokenAddress := systemContracts.FlowToken.Address - flowFeesAddress := systemContracts.FlowFees.Address - flowStorageFeesAddress := systemContracts.FlowStorageFees.Address - viewResolverAddress := systemContracts.ViewResolver.Address - metadataViewsAddress := systemContracts.MetadataViews.Address - fungibleTokenMetadataViewsAddress := common.Address(fungibleTokenAddress) - fungibleTokenSwitchboardAddress := common.Address(fungibleTokenAddress) - - burnerAddress := BurnerAddressForChain(chainID) - - var stakingCollectionAddress common.Address - var stakingProxyAddress common.Address + env := systemContracts.AsTemplateEnv() + env.BurnerAddress = BurnerAddressForChain(chainID).Hex() switch chainID { case flow.Mainnet: - stakingCollectionAddress = mustHexAddress("0x8d0e87b65159ae63") - stakingProxyAddress = mustHexAddress("0x62430cf28c26d095") + env.StakingCollectionAddress = "0x8d0e87b65159ae63" + env.StakingProxyAddress = "0x62430cf28c26d095" case flow.Testnet: - stakingCollectionAddress = mustHexAddress("0x95e019a17d0e23d7") - stakingProxyAddress = mustHexAddress("0x7aad92e5a0715d21") + env.StakingCollectionAddress = "0x95e019a17d0e23d7" + env.StakingProxyAddress = "0x7aad92e5a0715d21" case flow.Emulator, flow.Localnet: - stakingCollectionAddress = common.Address(serviceAccountAddress) - stakingProxyAddress = common.Address(serviceAccountAddress) + env.StakingCollectionAddress = env.ServiceAccountAddress + env.StakingProxyAddress = env.ServiceAccountAddress default: panic(fmt.Errorf("unsupported chain ID: %s", chainID)) } - lockedTokensAddress := stakingCollectionAddress + env.LockedTokensAddress = env.StakingCollectionAddress contractChanges := []StagedContract{ // epoch related contracts NewSystemContractChange( systemContracts.Epoch, coreContracts.FlowEpoch( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - idTableStakingAddress.HexWithPrefix(), - clusterQCAddress.HexWithPrefix(), - dkgAddress.HexWithPrefix(), - flowFeesAddress.HexWithPrefix(), + env, ), ), NewSystemContractChange( systemContracts.IDTableStaking, coreContracts.FlowIDTableStaking( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - flowFeesAddress.HexWithPrefix(), - burnerAddress.HexWithPrefix(), - true, + env, ), ), NewSystemContractChange( @@ -150,10 +121,7 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp NewSystemContractChange( systemContracts.FlowServiceAccount, coreContracts.FlowServiceAccount( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - flowFeesAddress.HexWithPrefix(), - flowStorageFeesAddress.HexWithPrefix(), + env, ), ), NewSystemContractChange( @@ -167,45 +135,28 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp NewSystemContractChange( systemContracts.FlowStorageFees, coreContracts.FlowStorageFees( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), + env, ), ), { - Address: stakingCollectionAddress, + Address: common.Address(flow.HexToAddress(env.StakingCollectionAddress)), Contract: Contract{ Name: "FlowStakingCollection", - Code: coreContracts.FlowStakingCollection( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - idTableStakingAddress.HexWithPrefix(), - stakingProxyAddress.HexWithPrefix(), - lockedTokensAddress.HexWithPrefix(), - flowStorageFeesAddress.HexWithPrefix(), - clusterQCAddress.HexWithPrefix(), - dkgAddress.HexWithPrefix(), - systemContracts.Epoch.Address.HexWithPrefix(), - ), + Code: coreContracts.FlowStakingCollection(env), }, }, { - Address: stakingProxyAddress, + Address: common.Address(flow.HexToAddress(env.StakingProxyAddress)), Contract: Contract{ Name: "StakingProxy", Code: coreContracts.FlowStakingProxy(), }, }, { - Address: lockedTokensAddress, + Address: common.Address(flow.HexToAddress(env.LockedTokensAddress)), Contract: Contract{ Name: "LockedTokens", - Code: coreContracts.FlowLockedTokens( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - idTableStakingAddress.HexWithPrefix(), - stakingProxyAddress.HexWithPrefix(), - flowStorageFeesAddress.HexWithPrefix(), - ), + Code: coreContracts.FlowLockedTokens(env), }, }, @@ -213,59 +164,45 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp NewSystemContractChange( systemContracts.FlowFees, coreContracts.FlowFees( - fungibleTokenAddress.HexWithPrefix(), - flowTokenAddress.HexWithPrefix(), - flowStorageFeesAddress.HexWithPrefix(), + env, ), ), NewSystemContractChange( systemContracts.FlowToken, coreContracts.FlowToken( - fungibleTokenAddress.HexWithPrefix(), - fungibleTokenMetadataViewsAddress.HexWithPrefix(), - metadataViewsAddress.HexWithPrefix(), - burnerAddress.HexWithPrefix(), + env, ), ), NewSystemContractChange( systemContracts.FungibleToken, - ftContracts.FungibleToken( - // Use `Hex()`, since this method adds the prefix. - viewResolverAddress.Hex(), - burnerAddress.Hex(), + coreContracts.FungibleToken( + env, ), ), { - Address: fungibleTokenMetadataViewsAddress, + Address: common.Address(flow.HexToAddress(env.FungibleTokenMetadataViewsAddress)), Contract: Contract{ Name: "FungibleTokenMetadataViews", - Code: ftContracts.FungibleTokenMetadataViews( - // Use `Hex()`, since this method adds the prefix. - fungibleTokenAddress.Hex(), - metadataViewsAddress.Hex(), - viewResolverAddress.Hex(), - ), + Code: coreContracts.FungibleTokenMetadataViews(env), }, }, // NFT related contracts NewSystemContractChange( systemContracts.NonFungibleToken, - nftContracts.NonFungibleToken( - sdk.Address(viewResolverAddress), + coreContracts.NonFungibleToken( + env, ), ), NewSystemContractChange( systemContracts.MetadataViews, - nftContracts.MetadataViews( - sdk.Address(fungibleTokenAddress), - sdk.Address(systemContracts.NonFungibleToken.Address), - sdk.Address(viewResolverAddress), + coreContracts.MetadataViews( + env, ), ), NewSystemContractChange( systemContracts.ViewResolver, - nftContracts.ViewResolver(), + coreContracts.ViewResolver(), ), } @@ -277,12 +214,10 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp contractChanges = append( contractChanges, StagedContract{ - Address: fungibleTokenSwitchboardAddress, + Address: common.Address(flow.HexToAddress(env.FungibleTokenSwitchboardAddress)), Contract: Contract{ Name: "FungibleTokenSwitchboard", - Code: ftContracts.FungibleTokenSwitchboard( - fungibleTokenAddress.HexWithPrefix(), - ), + Code: coreContracts.FungibleTokenSwitchboard(env), }, }, ) @@ -299,7 +234,7 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp NewSystemContractChange( systemContracts.EVMContract, evm.ContractCode( - flowTokenAddress, + flow.HexToAddress(env.FlowTokenAddress), abiOnly, ), ), @@ -311,14 +246,6 @@ func SystemContractChanges(chainID flow.ChainID, options SystemContractChangesOp return contractChanges } -func mustHexAddress(hexAddress string) common.Address { - address, err := common.HexToAddress(hexAddress) - if err != nil { - panic(err) - } - return address -} - func NewSystemContactsMigration( chainID flow.ChainID, options SystemContractChangesOptions, diff --git a/engine/execution/state/bootstrap/bootstrap_test.go b/engine/execution/state/bootstrap/bootstrap_test.go index f24b6609965..82db49066e3 100644 --- a/engine/execution/state/bootstrap/bootstrap_test.go +++ b/engine/execution/state/bootstrap/bootstrap_test.go @@ -53,7 +53,7 @@ func TestBootstrapLedger(t *testing.T) { } func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) { - expectedStateCommitmentBytes, _ := hex.DecodeString("60d6e4db7b60d4a36770b171fd6991bc4ab973eba1c513f9352ca3e6fd1782df") + expectedStateCommitmentBytes, _ := hex.DecodeString("d1a6903c063bd07e1824e17f6d1a6e1b6d8bdf564ffb41b53062206dcc2bc670") expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes) require.NoError(t, err) diff --git a/fvm/blueprints/epochs.go b/fvm/blueprints/epochs.go index fc5583cdc9d..cc274bd5671 100644 --- a/fvm/blueprints/epochs.go +++ b/fvm/blueprints/epochs.go @@ -44,6 +44,7 @@ func DeployEpochTransaction(service flow.Address, contract []byte, epochConfig e }, ), )). + AddArgument(jsoncdc.MustEncode(cadence.String("FlowEpoch"))). AddArgument(jsoncdc.MustEncode(cadence.String(hex.EncodeToString(contract)))). AddArgument(jsoncdc.MustEncode(epochConfig.CurrentEpochCounter)). AddArgument(jsoncdc.MustEncode(epochConfig.NumViewsInEpoch)). diff --git a/fvm/blueprints/fees.go b/fvm/blueprints/fees.go index 197ceb883b4..891e7be7a01 100644 --- a/fvm/blueprints/fees.go +++ b/fvm/blueprints/fees.go @@ -8,7 +8,6 @@ import ( "github.com/onflow/cadence" jsoncdc "github.com/onflow/cadence/encoding/json" "github.com/onflow/cadence/runtime/common" - "github.com/onflow/flow-core-contracts/lib/go/contracts" "github.com/onflow/flow-core-contracts/lib/go/templates" "github.com/onflow/flow-go/model/flow" @@ -45,12 +44,7 @@ var setupFeesTransactionTemplate string //go:embed scripts/setExecutionMemoryLimit.cdc var setExecutionMemoryLimit string -func DeployTxFeesContractTransaction(service, fungibleToken, flowToken, storageFees, flowFees flow.Address) *flow.TransactionBody { - contract := contracts.FlowFees( - fungibleToken.HexWithPrefix(), - flowToken.HexWithPrefix(), - storageFees.HexWithPrefix(), - ) +func DeployTxFeesContractTransaction(flowFees, service flow.Address, contract []byte) *flow.TransactionBody { return flow.NewTransactionBody(). SetScript([]byte(deployTxFeesTransactionTemplate)). diff --git a/fvm/blueprints/scripts/createFlowTokenMinterTransactionTemplate.cdc b/fvm/blueprints/scripts/createFlowTokenMinterTransactionTemplate.cdc index c66c60342d6..2b053f36484 100644 --- a/fvm/blueprints/scripts/createFlowTokenMinterTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/createFlowTokenMinterTransactionTemplate.cdc @@ -1,4 +1,4 @@ -import FlowToken from 0xFLOWTOKENADDRESS +import FlowToken from "FlowToken" transaction { prepare(serviceAccount: auth(Storage) &Account) { diff --git a/fvm/blueprints/scripts/deployEpochTransactionTemplate.cdc b/fvm/blueprints/scripts/deployEpochTransactionTemplate.cdc index 86a66e84895..52969ef9cc2 100644 --- a/fvm/blueprints/scripts/deployEpochTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/deployEpochTransactionTemplate.cdc @@ -1,6 +1,7 @@ -import FlowClusterQC from 0xQCADDRESS +import FlowClusterQC from "FlowClusterQC" transaction( + name: String, code: String, currentEpochCounter: UInt64, numViewsInEpoch: UInt64, @@ -21,7 +22,7 @@ transaction( } serviceAccount.contracts.add( - name: "FlowEpoch", + name: name, code: code.decodeHex(), currentEpochCounter: currentEpochCounter, numViewsInEpoch: numViewsInEpoch, diff --git a/fvm/blueprints/scripts/fundAccountTemplate.cdc b/fvm/blueprints/scripts/fundAccountTemplate.cdc index 4af4632173b..8e1de065873 100644 --- a/fvm/blueprints/scripts/fundAccountTemplate.cdc +++ b/fvm/blueprints/scripts/fundAccountTemplate.cdc @@ -1,5 +1,5 @@ -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" transaction(amount: UFix64, recipient: Address) { diff --git a/fvm/blueprints/scripts/mintFlowTokenTransactionTemplate.cdc b/fvm/blueprints/scripts/mintFlowTokenTransactionTemplate.cdc index bd8ad6c2a81..cee0e3fd701 100644 --- a/fvm/blueprints/scripts/mintFlowTokenTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/mintFlowTokenTransactionTemplate.cdc @@ -1,5 +1,5 @@ -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" transaction(amount: UFix64) { diff --git a/fvm/blueprints/scripts/setupAccountTemplate.cdc b/fvm/blueprints/scripts/setupAccountTemplate.cdc index 7494efc8766..6726d1d8a26 100644 --- a/fvm/blueprints/scripts/setupAccountTemplate.cdc +++ b/fvm/blueprints/scripts/setupAccountTemplate.cdc @@ -2,8 +2,8 @@ // to add a Vault resource to their account // so that they can use the flowToken -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" transaction { diff --git a/fvm/blueprints/scripts/setupFeesTransactionTemplate.cdc b/fvm/blueprints/scripts/setupFeesTransactionTemplate.cdc index 5c3b3be0ae2..8e54e4d6602 100644 --- a/fvm/blueprints/scripts/setupFeesTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/setupFeesTransactionTemplate.cdc @@ -1,4 +1,4 @@ -import FlowFees from 0xFLOWFEESADDRESS +import FlowFees from "FlowFees" transaction(surgeFactor: UFix64, inclusionEffortCost: UFix64, executionEffortCost: UFix64) { prepare(service: auth(BorrowValue) &Account) { diff --git a/fvm/blueprints/scripts/setupParametersTransactionTemplate.cdc b/fvm/blueprints/scripts/setupParametersTransactionTemplate.cdc index 637b22244ae..27336ffe3e3 100644 --- a/fvm/blueprints/scripts/setupParametersTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/setupParametersTransactionTemplate.cdc @@ -1,5 +1,5 @@ -import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS -import FlowServiceAccount from 0xFLOWSERVICEADDRESS +import FlowStorageFees from "FlowStorageFees" +import FlowServiceAccount from "FlowServiceAccount" transaction(accountCreationFee: UFix64, minimumStorageReservation: UFix64, storageMegaBytesPerReservedFLOW: UFix64, restrictedAccountCreationEnabled: Bool) { diff --git a/fvm/blueprints/scripts/setupStorageForAccount.cdc b/fvm/blueprints/scripts/setupStorageForAccount.cdc index 40d5b1ca0b6..31e04a67463 100644 --- a/fvm/blueprints/scripts/setupStorageForAccount.cdc +++ b/fvm/blueprints/scripts/setupStorageForAccount.cdc @@ -1,7 +1,7 @@ -import FlowServiceAccount from 0xFLOWSERVICEADDRESS -import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FlowServiceAccount from "FlowServiceAccount" +import FlowStorageFees from "FlowStorageFees" +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" // This transaction sets up storage on a auth account. // This is used during bootstrapping a local environment diff --git a/fvm/blueprints/scripts/setupStorageForServiceAccountsTemplate.cdc b/fvm/blueprints/scripts/setupStorageForServiceAccountsTemplate.cdc index 92def49607d..1f3a0b39154 100644 --- a/fvm/blueprints/scripts/setupStorageForServiceAccountsTemplate.cdc +++ b/fvm/blueprints/scripts/setupStorageForServiceAccountsTemplate.cdc @@ -1,7 +1,7 @@ -import FlowServiceAccount from 0xFLOWSERVICEADDRESS -import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FlowServiceAccount from "FlowServiceAccount" +import FlowStorageFees from "FlowStorageFees" +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" // This transaction sets up storage on any auth accounts that were created before the storage fees. // This is used during bootstrapping a local environment diff --git a/fvm/blueprints/scripts/systemChunkTransactionTemplate.cdc b/fvm/blueprints/scripts/systemChunkTransactionTemplate.cdc index 97318d3926b..222f6926ab2 100644 --- a/fvm/blueprints/scripts/systemChunkTransactionTemplate.cdc +++ b/fvm/blueprints/scripts/systemChunkTransactionTemplate.cdc @@ -1,6 +1,6 @@ -import FlowEpoch from 0xEPOCHADDRESS -import NodeVersionBeacon from 0xNODEVERSIONBEACONADDRESS -import RandomBeaconHistory from 0xRANDOMBEACONHISTORYADDRESS +import FlowEpoch from "FlowEpoch" +import NodeVersionBeacon from "NodeVersionBeacon" +import RandomBeaconHistory from "RandomBeaconHistory" transaction { prepare(serviceAccount: auth(BorrowValue) &Account) { diff --git a/fvm/blueprints/token.go b/fvm/blueprints/token.go index 8ca32f372b0..a7f70753a67 100644 --- a/fvm/blueprints/token.go +++ b/fvm/blueprints/token.go @@ -14,8 +14,7 @@ import ( "github.com/onflow/flow-go/model/flow" ) -func DeployFungibleTokenContractTransaction(fungibleToken, viewResolver, burner flow.Address) *flow.TransactionBody { - contract := contracts.FungibleToken(viewResolver.Hex(), burner.Hex()) +func DeployFungibleTokenContractTransaction(fungibleToken flow.Address, contract []byte) *flow.TransactionBody { contractName := "FungibleToken" return DeployContractTransaction( fungibleToken, @@ -24,8 +23,7 @@ func DeployFungibleTokenContractTransaction(fungibleToken, viewResolver, burner ) } -func DeployNonFungibleTokenContractTransaction(nonFungibleToken, viewResolver flow.Address) *flow.TransactionBody { - contract := contracts.NonFungibleToken(viewResolver.HexWithPrefix()) +func DeployNonFungibleTokenContractTransaction(nonFungibleToken flow.Address, contract []byte) *flow.TransactionBody { contractName := "NonFungibleToken" return DeployContractTransaction( nonFungibleToken, @@ -34,8 +32,7 @@ func DeployNonFungibleTokenContractTransaction(nonFungibleToken, viewResolver fl ) } -func DeployMetadataViewsContractTransaction(fungibleToken, nonFungibleToken, viewResolver flow.Address) *flow.TransactionBody { - contract := contracts.MetadataViews(fungibleToken.HexWithPrefix(), nonFungibleToken.HexWithPrefix(), viewResolver.HexWithPrefix()) +func DeployMetadataViewsContractTransaction(nonFungibleToken flow.Address, contract []byte) *flow.TransactionBody { contractName := "MetadataViews" return DeployContractTransaction( nonFungibleToken, @@ -64,8 +61,8 @@ func DeployBurnerContractTransaction(fungibleToken flow.Address) *flow.Transacti ) } -func DeployFungibleTokenMetadataViewsContractTransaction(fungibleToken, nonFungibleToken, viewResolver flow.Address) *flow.TransactionBody { - contract := contracts.FungibleTokenMetadataViews(fungibleToken.Hex(), nonFungibleToken.Hex(), viewResolver.Hex()) +func DeployFungibleTokenMetadataViewsContractTransaction(fungibleToken flow.Address, contract []byte) *flow.TransactionBody { + contractName := "FungibleTokenMetadataViews" return DeployContractTransaction( fungibleToken, @@ -74,8 +71,8 @@ func DeployFungibleTokenMetadataViewsContractTransaction(fungibleToken, nonFungi ) } -func DeployFungibleTokenSwitchboardContractTransaction(fungibleToken flow.Address) *flow.TransactionBody { - contract := contracts.FungibleTokenSwitchboard(fungibleToken.Hex()) +func DeployFungibleTokenSwitchboardContractTransaction(fungibleToken flow.Address, contract []byte) *flow.TransactionBody { + contractName := "FungibleTokenSwitchboard" return DeployContractTransaction( fungibleToken, @@ -93,8 +90,7 @@ var createFlowTokenMinterTransactionTemplate string //go:embed scripts/mintFlowTokenTransactionTemplate.cdc var mintFlowTokenTransactionTemplate string -func DeployFlowTokenContractTransaction(service, fungibleToken, metadataViews, flowToken flow.Address) *flow.TransactionBody { - contract := contracts.FlowToken(fungibleToken.HexWithPrefix(), fungibleToken.HexWithPrefix(), metadataViews.HexWithPrefix(), metadataViews.HexWithPrefix()) +func DeployFlowTokenContractTransaction(service, flowToken flow.Address, contract []byte) *flow.TransactionBody { return flow.NewTransactionBody(). SetScript([]byte(deployFlowTokenTransactionTemplate)). diff --git a/fvm/bootstrap.go b/fvm/bootstrap.go index 1ec4f8c5e40..750f2d9d89a 100644 --- a/fvm/bootstrap.go +++ b/fvm/bootstrap.go @@ -6,6 +6,7 @@ import ( "github.com/onflow/cadence" "github.com/onflow/flow-core-contracts/lib/go/contracts" + "github.com/onflow/flow-core-contracts/lib/go/templates" "github.com/onflow/flow-go/fvm/blueprints" "github.com/onflow/flow-go/fvm/environment" @@ -341,24 +342,28 @@ func (b *bootstrapExecutor) Execute() error { service := b.createServiceAccount() - b.deployViewResolver(service) - b.deployBurner(service) + env := templates.Environment{ + ServiceAccountAddress: service.String(), + } + + b.deployViewResolver(service, &env) + b.deployBurner(service, &env) - fungibleToken := b.deployFungibleToken(service, service) - nonFungibleToken := b.deployNonFungibleToken(service, service) + fungibleToken := b.deployFungibleToken(&env) + nonFungibleToken := b.deployNonFungibleToken(service, &env) - b.deployMetadataViews(fungibleToken, nonFungibleToken, service) - b.deployFungibleTokenSwitchboard(fungibleToken) + b.deployMetadataViews(fungibleToken, nonFungibleToken, &env) + b.deployFungibleTokenSwitchboard(fungibleToken, &env) - flowToken := b.deployFlowToken(service, fungibleToken, nonFungibleToken) - storageFees := b.deployStorageFees(service, fungibleToken, flowToken) - feeContract := b.deployFlowFees(service, fungibleToken, flowToken, storageFees) + flowToken := b.deployFlowToken(service, &env) + b.deployStorageFees(service, &env) + feeContract := b.deployFlowFees(service, &env) if b.initialTokenSupply > 0 { b.mintInitialTokens(service, fungibleToken, flowToken, b.initialTokenSupply) } - b.deployServiceAccount(service, fungibleToken, flowToken, feeContract) + b.deployServiceAccount(service, &env) b.setupParameters( service, @@ -384,26 +389,26 @@ func (b *bootstrapExecutor) Execute() error { b.createMinter(service, flowToken) - b.deployDKG(service) + b.deployDKG(service, &env) - b.deployQC(service) + b.deployQC(service, &env) - b.deployIDTableStaking(service, fungibleToken, flowToken, feeContract, service) + b.deployIDTableStaking(service, &env) - b.deployEpoch(service, fungibleToken, flowToken, feeContract) + b.deployEpoch(service, &env) - b.deployVersionBeacon(service, b.versionFreezePeriod) + b.deployVersionBeacon(service, b.versionFreezePeriod, &env) - b.deployRandomBeaconHistory(service) + b.deployRandomBeaconHistory(service, &env) // deploy staking proxy contract to the service account - b.deployStakingProxyContract(service) + b.deployStakingProxyContract(service, &env) // deploy locked tokens contract to the service account - b.deployLockedTokensContract(service, fungibleToken, flowToken) + b.deployLockedTokensContract(service, &env) // deploy staking collection contract to the service account - b.deployStakingCollection(service, fungibleToken, flowToken) + b.deployStakingCollection(service, &env) b.registerNodes(service, fungibleToken, flowToken) @@ -435,32 +440,38 @@ func (b *bootstrapExecutor) createServiceAccount() flow.Address { return address } -func (b *bootstrapExecutor) deployFungibleToken(viewResolver, burner flow.Address) flow.Address { +func (b *bootstrapExecutor) deployFungibleToken(env *templates.Environment) flow.Address { fungibleToken := b.createAccount(b.accountKeys.FungibleTokenAccountPublicKeys) + contract := contracts.FungibleToken(*env) + txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployFungibleTokenContractTransaction(fungibleToken, viewResolver, burner), + blueprints.DeployFungibleTokenContractTransaction(fungibleToken, contract), 0), ) + env.FungibleTokenAddress = fungibleToken.String() panicOnMetaInvokeErrf("failed to deploy fungible token contract: %s", txError, err) return fungibleToken } -func (b *bootstrapExecutor) deployNonFungibleToken(deployTo, viewResolver flow.Address) flow.Address { +func (b *bootstrapExecutor) deployNonFungibleToken(deployTo flow.Address, env *templates.Environment) flow.Address { + + contract := contracts.NonFungibleToken(*env) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployNonFungibleTokenContractTransaction(deployTo, viewResolver), + blueprints.DeployNonFungibleTokenContractTransaction(deployTo, contract), 0), ) + env.NonFungibleTokenAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy non-fungible token contract: %s", txError, err) return deployTo } -func (b *bootstrapExecutor) deployViewResolver(deployTo flow.Address) { +func (b *bootstrapExecutor) deployViewResolver(deployTo flow.Address, env *templates.Environment) { txError, err := b.invokeMetaTransaction( b.ctx, @@ -468,10 +479,11 @@ func (b *bootstrapExecutor) deployViewResolver(deployTo flow.Address) { blueprints.DeployViewResolverContractTransaction(deployTo), 0), ) + env.ViewResolverAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy view resolver contract: %s", txError, err) } -func (b *bootstrapExecutor) deployBurner(deployTo flow.Address) { +func (b *bootstrapExecutor) deployBurner(deployTo flow.Address, env *templates.Environment) { txError, err := b.invokeMetaTransaction( b.ctx, @@ -479,91 +491,104 @@ func (b *bootstrapExecutor) deployBurner(deployTo flow.Address) { blueprints.DeployBurnerContractTransaction(deployTo), 0), ) + env.BurnerAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy burner contract: %s", txError, err) } -func (b *bootstrapExecutor) deployMetadataViews(fungibleToken, nonFungibleToken, viewResolver flow.Address) { +func (b *bootstrapExecutor) deployMetadataViews(fungibleToken, nonFungibleToken flow.Address, env *templates.Environment) { + + mvContract := contracts.MetadataViews(*env) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployMetadataViewsContractTransaction(fungibleToken, nonFungibleToken, viewResolver), + blueprints.DeployMetadataViewsContractTransaction(nonFungibleToken, mvContract), 0), ) + env.MetadataViewsAddress = nonFungibleToken.String() panicOnMetaInvokeErrf("failed to deploy metadata views contract: %s", txError, err) + ftmvContract := contracts.FungibleTokenMetadataViews(*env) + txError, err = b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployFungibleTokenMetadataViewsContractTransaction(fungibleToken, nonFungibleToken, viewResolver), + blueprints.DeployFungibleTokenMetadataViewsContractTransaction(fungibleToken, ftmvContract), 0), ) + env.FungibleTokenMetadataViewsAddress = fungibleToken.String() panicOnMetaInvokeErrf("failed to deploy fungible token metadata views contract: %s", txError, err) } -func (b *bootstrapExecutor) deployFungibleTokenSwitchboard(tokenStandardAccount flow.Address) { +func (b *bootstrapExecutor) deployFungibleTokenSwitchboard(deployTo flow.Address, env *templates.Environment) { + + contract := contracts.FungibleTokenSwitchboard(*env) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployFungibleTokenSwitchboardContractTransaction(tokenStandardAccount), + blueprints.DeployFungibleTokenSwitchboardContractTransaction(deployTo, contract), 0), ) + env.FungibleTokenSwitchboardAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy fungible token switchboard contract: %s", txError, err) } -func (b *bootstrapExecutor) deployFlowToken(service, fungibleToken, metadataViews flow.Address) flow.Address { +func (b *bootstrapExecutor) deployFlowToken(service flow.Address, env *templates.Environment) flow.Address { flowToken := b.createAccount(b.accountKeys.FlowTokenAccountPublicKeys) + + contract := contracts.FlowToken(*env) + txError, err := b.invokeMetaTransaction( b.ctx, Transaction( blueprints.DeployFlowTokenContractTransaction( service, - fungibleToken, - metadataViews, - flowToken), + flowToken, + contract), 0), ) + env.FlowTokenAddress = flowToken.String() panicOnMetaInvokeErrf("failed to deploy Flow token contract: %s", txError, err) return flowToken } -func (b *bootstrapExecutor) deployFlowFees(service, fungibleToken, flowToken, storageFees flow.Address) flow.Address { +func (b *bootstrapExecutor) deployFlowFees(service flow.Address, env *templates.Environment) flow.Address { flowFees := b.createAccount(b.accountKeys.FlowFeesAccountPublicKeys) + contract := contracts.FlowFees( + *env, + ) + txError, err := b.invokeMetaTransaction( b.ctx, Transaction( blueprints.DeployTxFeesContractTransaction( - service, - fungibleToken, - flowToken, - storageFees, flowFees, + service, + contract, ), 0), ) + env.FlowFeesAddress = flowFees.String() panicOnMetaInvokeErrf("failed to deploy fees contract: %s", txError, err) return flowFees } -func (b *bootstrapExecutor) deployStorageFees(service, fungibleToken, flowToken flow.Address) flow.Address { - contract := contracts.FlowStorageFees( - fungibleToken.HexWithPrefix(), - flowToken.HexWithPrefix(), - ) +func (b *bootstrapExecutor) deployStorageFees(deployTo flow.Address, env *templates.Environment) { + contract := contracts.FlowStorageFees(*env) // deploy storage fees contract on the service account txError, err := b.invokeMetaTransaction( b.ctx, Transaction( blueprints.DeployStorageFeesContractTransaction( - service, + deployTo, contract), 0), ) + env.StorageFeesAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy storage fees contract: %s", txError, err) - return service } func (b *bootstrapExecutor) createMinter(service, flowToken flow.Address) { @@ -578,62 +603,55 @@ func (b *bootstrapExecutor) createMinter(service, flowToken flow.Address) { panicOnMetaInvokeErrf("failed to create flow token minter: %s", txError, err) } -func (b *bootstrapExecutor) deployDKG(service flow.Address) { +func (b *bootstrapExecutor) deployDKG(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowDKG() txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployContractTransaction(service, contract, "FlowDKG"), + blueprints.DeployContractTransaction(deployTo, contract, "FlowDKG"), 0, ), ) + env.DkgAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy DKG contract: %s", txError, err) } -func (b *bootstrapExecutor) deployQC(service flow.Address) { +func (b *bootstrapExecutor) deployQC(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowQC() txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployContractTransaction(service, contract, "FlowClusterQC"), + blueprints.DeployContractTransaction(deployTo, contract, "FlowClusterQC"), 0, ), ) + env.QuorumCertificateAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy QC contract: %s", txError, err) } -func (b *bootstrapExecutor) deployIDTableStaking(service, fungibleToken, flowToken, flowFees, burner flow.Address) { +func (b *bootstrapExecutor) deployIDTableStaking(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowIDTableStaking( - fungibleToken.HexWithPrefix(), - flowToken.HexWithPrefix(), - flowFees.HexWithPrefix(), - burner.HexWithPrefix(), - true) + *env, + ) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployIDTableStakingTransaction(service, + blueprints.DeployIDTableStakingTransaction(deployTo, contract, b.epochConfig.EpochTokenPayout, b.epochConfig.RewardCut), 0, ), ) + env.IDTableAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy IDTableStaking contract: %s", txError, err) } -func (b *bootstrapExecutor) deployEpoch(service, fungibleToken, flowToken, flowFees flow.Address) { +func (b *bootstrapExecutor) deployEpoch(deployTo flow.Address, env *templates.Environment) { - contract := contracts.FlowEpoch( - fungibleToken.HexWithPrefix(), - flowToken.HexWithPrefix(), - service.HexWithPrefix(), - service.HexWithPrefix(), - service.HexWithPrefix(), - flowFees.HexWithPrefix(), - ) + contract := contracts.FlowEpoch(*env) context := NewContextFromParent(b.ctx, WithBlockHeader(b.rootBlock), @@ -643,26 +661,24 @@ func (b *bootstrapExecutor) deployEpoch(service, fungibleToken, flowToken, flowF txError, err := b.invokeMetaTransaction( context, Transaction( - blueprints.DeployEpochTransaction(service, contract, b.epochConfig), + blueprints.DeployEpochTransaction(deployTo, contract, b.epochConfig), 0, ), ) + env.EpochAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy Epoch contract: %s", txError, err) } -func (b *bootstrapExecutor) deployServiceAccount(service, fungibleToken, flowToken, feeContract flow.Address) { +func (b *bootstrapExecutor) deployServiceAccount(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowServiceAccount( - fungibleToken.HexWithPrefix(), - flowToken.HexWithPrefix(), - feeContract.HexWithPrefix(), - service.HexWithPrefix(), + *env, ) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( blueprints.DeployContractTransaction( - service, + deployTo, contract, "FlowServiceAccount"), 0), @@ -919,23 +935,25 @@ func (b *bootstrapExecutor) registerNodes(service, fungibleToken, flowToken flow } } -func (b *bootstrapExecutor) deployStakingProxyContract(service flow.Address) { +func (b *bootstrapExecutor) deployStakingProxyContract(deployTo flow.Address, env *templates.Environment) { contract := contracts.FlowStakingProxy() txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployContractTransaction(service, contract, "StakingProxy"), + blueprints.DeployContractTransaction(deployTo, contract, "StakingProxy"), 0, ), ) + env.StakingProxyAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy StakingProxy contract: %s", txError, err) } func (b *bootstrapExecutor) deployVersionBeacon( - service flow.Address, + deployTo flow.Address, versionFreezePeriod cadence.UInt64, + env *templates.Environment, ) { - tx := blueprints.DeployNodeVersionBeaconTransaction(service, versionFreezePeriod) + tx := blueprints.DeployNodeVersionBeaconTransaction(deployTo, versionFreezePeriod) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( @@ -943,13 +961,15 @@ func (b *bootstrapExecutor) deployVersionBeacon( 0, ), ) + env.NodeVersionBeaconAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy NodeVersionBeacon contract: %s", txError, err) } func (b *bootstrapExecutor) deployRandomBeaconHistory( - service flow.Address, + deployTo flow.Address, + env *templates.Environment, ) { - tx := blueprints.DeployRandomBeaconHistoryTransaction(service) + tx := blueprints.DeployRandomBeaconHistoryTransaction(deployTo) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( @@ -957,12 +977,13 @@ func (b *bootstrapExecutor) deployRandomBeaconHistory( 0, ), ) + env.RandomBeaconHistoryAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy RandomBeaconHistory history contract: %s", txError, err) } func (b *bootstrapExecutor) deployLockedTokensContract( - service flow.Address, fungibleTokenAddress, - flowTokenAddress flow.Address, + deployTo flow.Address, + env *templates.Environment, ) { publicKeys, err := flow.EncodeRuntimeAccountPublicKeys(b.accountKeys.ServiceAccountPublicKeys) @@ -970,45 +991,32 @@ func (b *bootstrapExecutor) deployLockedTokensContract( panic(err) } - contract := contracts.FlowLockedTokens( - fungibleTokenAddress.Hex(), - flowTokenAddress.Hex(), - service.Hex(), - service.Hex(), - service.Hex()) + contract := contracts.FlowLockedTokens(*env) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployLockedTokensTransaction(service, contract, publicKeys), + blueprints.DeployLockedTokensTransaction(deployTo, contract, publicKeys), 0, ), ) - + env.LockedTokensAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy LockedTokens contract: %s", txError, err) } func (b *bootstrapExecutor) deployStakingCollection( - service flow.Address, - fungibleTokenAddress, flowTokenAddress flow.Address, + deployTo flow.Address, + env *templates.Environment, ) { - contract := contracts.FlowStakingCollection( - fungibleTokenAddress.Hex(), - flowTokenAddress.Hex(), - service.Hex(), - service.Hex(), - service.Hex(), - service.Hex(), - service.Hex(), - service.Hex(), - service.Hex()) + contract := contracts.FlowStakingCollection(*env) txError, err := b.invokeMetaTransaction( b.ctx, Transaction( - blueprints.DeployContractTransaction(service, contract, "FlowStakingCollection"), + blueprints.DeployContractTransaction(deployTo, contract, "FlowStakingCollection"), 0, ), ) + env.StakingCollectionAddress = deployTo.String() panicOnMetaInvokeErrf("failed to deploy FlowStakingCollection contract: %s", txError, err) } diff --git a/fvm/evm/stdlib/contract_test.go b/fvm/evm/stdlib/contract_test.go index 308fb95e367..6bcb5b4b2a0 100644 --- a/fvm/evm/stdlib/contract_test.go +++ b/fvm/evm/stdlib/contract_test.go @@ -13,6 +13,7 @@ import ( cadenceStdlib "github.com/onflow/cadence/runtime/stdlib" "github.com/onflow/cadence/runtime/tests/utils" coreContracts "github.com/onflow/flow-core-contracts/lib/go/contracts" + coreContractstemplates "github.com/onflow/flow-core-contracts/lib/go/templates" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -167,6 +168,16 @@ func deployContracts( contractsAddressHex := contractsAddress.Hex() + env := coreContractstemplates.Environment{ + ServiceAccountAddress: contractsAddressHex, + ViewResolverAddress: contractsAddressHex, + BurnerAddress: contractsAddressHex, + FungibleTokenAddress: contractsAddressHex, + NonFungibleTokenAddress: contractsAddressHex, + MetadataViewsAddress: contractsAddressHex, + FungibleTokenMetadataViewsAddress: contractsAddressHex, + } + contracts := []struct { name string code []byte @@ -183,39 +194,31 @@ func deployContracts( { name: "FungibleToken", code: coreContracts.FungibleToken( - contractsAddressHex, - contractsAddressHex, + env, ), }, { name: "NonFungibleToken", code: coreContracts.NonFungibleToken( - contractsAddressHex, + env, ), }, { name: "MetadataViews", code: coreContracts.MetadataViews( - contractsAddressHex, - contractsAddressHex, - contractsAddressHex, + env, ), }, { name: "FungibleTokenMetadataViews", code: coreContracts.FungibleTokenMetadataViews( - contractsAddressHex, - contractsAddressHex, - contractsAddressHex, + env, ), }, { name: "FlowToken", code: coreContracts.FlowToken( - contractsAddressHex, - contractsAddressHex, - contractsAddressHex, - contractsAddressHex, + env, ), deployTx: []byte(` transaction(name: String, code: String) { diff --git a/fvm/systemcontracts/system_contracts.go b/fvm/systemcontracts/system_contracts.go index a0c3a39848d..02985a77510 100644 --- a/fvm/systemcontracts/system_contracts.go +++ b/fvm/systemcontracts/system_contracts.go @@ -135,9 +135,10 @@ type SystemContracts struct { FlowStorageFees SystemContract // token related contracts - FlowFees SystemContract - FlowToken SystemContract - FungibleToken SystemContract + FlowFees SystemContract + FlowToken SystemContract + FungibleToken SystemContract + FungibleTokenMetadataViews SystemContract // NFT related contracts NonFungibleToken SystemContract @@ -163,18 +164,14 @@ func (c SystemContracts) AsTemplateEnv() templates.Environment { RandomBeaconHistoryAddress: c.RandomBeaconHistory.Address.Hex(), StorageFeesAddress: c.FlowStorageFees.Address.Hex(), - FlowFeesAddress: c.FlowFees.Address.Hex(), - FlowTokenAddress: c.FlowToken.Address.Hex(), - FungibleTokenAddress: c.FungibleToken.Address.Hex(), + FlowFeesAddress: c.FlowFees.Address.Hex(), + FlowTokenAddress: c.FlowToken.Address.Hex(), + FungibleTokenAddress: c.FungibleToken.Address.Hex(), + FungibleTokenMetadataViewsAddress: c.FungibleToken.Address.Hex(), - // The following contracts dont exist on the template env yet - // that is not a problem, but they are still listed here for completeness. - - // NonFungibleToken: c.NonFungibleToken.Address.Hex(), - // MetadataViews : c.MetadataViews.Address.Hex(), - // ViewResolver : c.ViewResolver.Address.Hex(), - - // EVMAddress: c.EVM.Address.Hex(), + NonFungibleTokenAddress: c.NonFungibleToken.Address.Hex(), + MetadataViewsAddress: c.MetadataViews.Address.Hex(), + ViewResolverAddress: c.ViewResolver.Address.Hex(), } } diff --git a/go.mod b/go.mod index d4df1c6c6b2..a1d1847893a 100644 --- a/go.mod +++ b/go.mod @@ -54,8 +54,8 @@ require ( github.com/onflow/cadence v1.0.0-M8 github.com/onflow/crypto v0.25.0 github.com/onflow/flow v0.3.4 - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b github.com/onflow/flow-go-sdk v1.0.0-M6 github.com/onflow/flow/protobuf/go/flow v0.3.7 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 @@ -107,8 +107,6 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/ipfs/boxo v0.17.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 github.com/onflow/wal v0.0.0-20240208022732-d756cd497d3b github.com/slok/go-http-metrics v0.10.0 github.com/sony/gobreaker v0.5.0 @@ -261,6 +259,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect diff --git a/go.sum b/go.sum index 07e2caf589c..8f631b2e520 100644 --- a/go.sum +++ b/go.sum @@ -2493,17 +2493,21 @@ github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= 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 v0.15.2-0.20240206003101-928bf99024d7 h1:OI/4F2NK/X/4x3dTUFFDGtuOsSa9pX+jjBeSEcBrY/M= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:GK+Ik1K3L3v8xmHmRQv5yxJz81lYhdYSNm0PQ63Xrws= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 h1:WAx8ftVz1BeXiKvQ9gLKEf1J3NBWK26Pbczd0iH4C6I= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 h1:u6/YcUvO8jU0f3Evb/6agzXqeOo+VbL2a3mmj/5ifRs= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b h1:oXHQft30sElpK7G3xWB5tEizI2G+S4p64iVh0LtX4E0= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:At+gEXmy13wpvxHYlS8bqjKEBufL+UXMQpJyHQxiXY8= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b h1:oiV9EbViI07FiO4rKeJ5/RGoQDCGd4c6SX/cdMwHbFE= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:cTE5NCp+Zk04yA24gCEjBdQIrzDU/iRICgLSx4LsGX0= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 h1:mV3OXBTDJ+nP3sJkoEUgrBXG2bMGFqsDTDr0nVmj2ec= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 h1:fZj39XxayIL7uvKvonNI3MtQM3wsFJ8oRl/XW/0rn7A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-M6 h1:FNITFgDhdo2H7mZY5bJPWD87k1MyJreBz87N8Xk9+xY= github.com/onflow/flow-go-sdk v1.0.0-M6/go.mod h1:aXSavLzoRlz5FiMjcI7p5QhihWScGctxydzf4dv/avo= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 h1:/2vvjKkWG/3cKP3IpgiGNqXi0yskn4GmNTjmeCwMoz8= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a h1:xMEtuQp4+ltfEZcw+4smv4wechSBAus4yEAtPghXZeQ= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a h1:Ark2dPAaSxSr45G5WJjB1P5H0tFtXnHcOIp+dM146yo= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.3.7 h1:+6sBdlE/u4ZMTVB9U1lA6Xn2Bd48lOOX96Bv9dNubsk= github.com/onflow/flow/protobuf/go/flow v0.3.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/insecure/go.mod b/insecure/go.mod index ed59ce01f41..edfd9afffc4 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -206,11 +206,13 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f // indirect github.com/onflow/cadence v1.0.0-M8 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 // indirect - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 // indirect + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b // indirect + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 // indirect github.com/onflow/flow-go-sdk v1.0.0-M6 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a // indirect github.com/onflow/flow/protobuf/go/flow v0.3.7 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onflow/wal v0.0.0-20240208022732-d756cd497d3b // indirect diff --git a/insecure/go.sum b/insecure/go.sum index 21adaf942be..2ad895fda94 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -2476,17 +2476,21 @@ github.com/onflow/cadence v1.0.0-M8 h1:ioQ7TyhpsIaImAC7Xn2r8kIgIBdimvyuWeKlGfRxW github.com/onflow/cadence v1.0.0-M8/go.mod h1:a4mccDU90hmuxCLUFzs9J/ANG/rYbFa36h4Z0bBAqNU= github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 h1:OI/4F2NK/X/4x3dTUFFDGtuOsSa9pX+jjBeSEcBrY/M= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:GK+Ik1K3L3v8xmHmRQv5yxJz81lYhdYSNm0PQ63Xrws= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 h1:WAx8ftVz1BeXiKvQ9gLKEf1J3NBWK26Pbczd0iH4C6I= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 h1:u6/YcUvO8jU0f3Evb/6agzXqeOo+VbL2a3mmj/5ifRs= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b h1:oXHQft30sElpK7G3xWB5tEizI2G+S4p64iVh0LtX4E0= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:At+gEXmy13wpvxHYlS8bqjKEBufL+UXMQpJyHQxiXY8= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b h1:oiV9EbViI07FiO4rKeJ5/RGoQDCGd4c6SX/cdMwHbFE= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:cTE5NCp+Zk04yA24gCEjBdQIrzDU/iRICgLSx4LsGX0= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 h1:mV3OXBTDJ+nP3sJkoEUgrBXG2bMGFqsDTDr0nVmj2ec= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 h1:fZj39XxayIL7uvKvonNI3MtQM3wsFJ8oRl/XW/0rn7A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-M6 h1:FNITFgDhdo2H7mZY5bJPWD87k1MyJreBz87N8Xk9+xY= github.com/onflow/flow-go-sdk v1.0.0-M6/go.mod h1:aXSavLzoRlz5FiMjcI7p5QhihWScGctxydzf4dv/avo= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 h1:/2vvjKkWG/3cKP3IpgiGNqXi0yskn4GmNTjmeCwMoz8= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a h1:xMEtuQp4+ltfEZcw+4smv4wechSBAus4yEAtPghXZeQ= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a h1:Ark2dPAaSxSr45G5WJjB1P5H0tFtXnHcOIp+dM146yo= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.3.7 h1:+6sBdlE/u4ZMTVB9U1lA6Xn2Bd48lOOX96Bv9dNubsk= github.com/onflow/flow/protobuf/go/flow v0.3.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/benchmark/scripts/scripts.go b/integration/benchmark/scripts/scripts.go index d38f6a842b7..e459a2c0eac 100644 --- a/integration/benchmark/scripts/scripts.go +++ b/integration/benchmark/scripts/scripts.go @@ -51,8 +51,8 @@ var tokenTransferTransactionTemplate string // TokenTransferTransaction returns a transaction script for transferring `amount` flow tokens to `toAddr` address func TokenTransferTransaction(ftAddr, flowToken, toAddr flow.Address, amount cadence.UFix64) (*flowsdk.Transaction, error) { - withFTAddr := strings.Replace(tokenTransferTransactionTemplate, "0xFUNGIBLETOKENADDRESS", "0x"+ftAddr.Hex(), 1) - withFlowTokenAddr := strings.Replace(withFTAddr, "0xTOKENADDRESS", "0x"+flowToken.Hex(), 1) + withFTAddr := strings.Replace(tokenTransferTransactionTemplate, "\"FungibleToken\"", "0x"+ftAddr.Hex(), 1) + withFlowTokenAddr := strings.Replace(withFTAddr, "\"FlowToken\"", "0x"+flowToken.Hex(), 1) tx := flowsdk.NewTransaction(). SetScript([]byte(withFlowTokenAddr)) diff --git a/integration/benchmark/scripts/tokenTransferTransaction.cdc b/integration/benchmark/scripts/tokenTransferTransaction.cdc index 4b0e5351c5e..74e36ca02f5 100644 --- a/integration/benchmark/scripts/tokenTransferTransaction.cdc +++ b/integration/benchmark/scripts/tokenTransferTransaction.cdc @@ -1,5 +1,5 @@ -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xTOKENADDRESS +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" transaction(amount: UFix64, to: Address) { let sentVault: @{FungibleToken.Vault} diff --git a/integration/go.mod b/integration/go.mod index c4e197b7a50..9da66486cfa 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -22,10 +22,10 @@ require ( github.com/ipfs/go-ipfs-blockstore v1.3.0 github.com/onflow/cadence v1.0.0-M8 github.com/onflow/crypto v0.25.0 - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 - github.com/onflow/flow-emulator v1.0.0-M2.0.20240213001509-046672c2367a - github.com/onflow/flow-go v0.33.2-0.20240213000303-9fb4c62e8291 + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b + github.com/onflow/flow-emulator v1.0.0-M7.0.20240227020422-2ec59747f9be + github.com/onflow/flow-go v0.34.0-crescendo-preview.2.0.20240227001756-cb6311412b78 github.com/onflow/flow-go-sdk v1.0.0-M6 github.com/onflow/flow-go/insecure v0.0.0-00010101000000-000000000000 github.com/onflow/flow/protobuf/go/flow v0.3.7 @@ -252,8 +252,10 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 // indirect + github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a // indirect + github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/onflow/wal v0.0.0-20240208022732-d756cd497d3b // indirect github.com/onsi/ginkgo/v2 v2.13.2 // indirect diff --git a/integration/go.sum b/integration/go.sum index 7695f1d499f..2884a28b907 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -2552,19 +2552,23 @@ github.com/onflow/cadence v1.0.0-M8 h1:ioQ7TyhpsIaImAC7Xn2r8kIgIBdimvyuWeKlGfRxW github.com/onflow/cadence v1.0.0-M8/go.mod h1:a4mccDU90hmuxCLUFzs9J/ANG/rYbFa36h4Z0bBAqNU= github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 h1:OI/4F2NK/X/4x3dTUFFDGtuOsSa9pX+jjBeSEcBrY/M= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:GK+Ik1K3L3v8xmHmRQv5yxJz81lYhdYSNm0PQ63Xrws= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 h1:WAx8ftVz1BeXiKvQ9gLKEf1J3NBWK26Pbczd0iH4C6I= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg= -github.com/onflow/flow-emulator v1.0.0-M2.0.20240213001509-046672c2367a h1:Si1w6KjM+tPq7LjVwt7QX3Lh4nbUZ4quNWhdtZwsPLQ= -github.com/onflow/flow-emulator v1.0.0-M2.0.20240213001509-046672c2367a/go.mod h1:G+0/cyxeqsZ3SnJPrl0dnbtBooz05v077pWqHBgpHBU= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 h1:u6/YcUvO8jU0f3Evb/6agzXqeOo+VbL2a3mmj/5ifRs= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b h1:oXHQft30sElpK7G3xWB5tEizI2G+S4p64iVh0LtX4E0= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:At+gEXmy13wpvxHYlS8bqjKEBufL+UXMQpJyHQxiXY8= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b h1:oiV9EbViI07FiO4rKeJ5/RGoQDCGd4c6SX/cdMwHbFE= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240227190927-0e6ce7e3222b/go.mod h1:cTE5NCp+Zk04yA24gCEjBdQIrzDU/iRICgLSx4LsGX0= +github.com/onflow/flow-emulator v1.0.0-M7.0.20240227020422-2ec59747f9be h1:n6Zi/9uRQhI9Lpzi87tozuOzuV9KZhUGI7QI7H4LnMc= +github.com/onflow/flow-emulator v1.0.0-M7.0.20240227020422-2ec59747f9be/go.mod h1:lr5R66ZAhCaXnotdyXe0iI7bi8s/cIM/4mu0if2JXEQ= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876 h1:mV3OXBTDJ+nP3sJkoEUgrBXG2bMGFqsDTDr0nVmj2ec= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240213220156-959b70719876/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876 h1:fZj39XxayIL7uvKvonNI3MtQM3wsFJ8oRl/XW/0rn7A= +github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240213220156-959b70719876/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= github.com/onflow/flow-go-sdk v1.0.0-M6 h1:FNITFgDhdo2H7mZY5bJPWD87k1MyJreBz87N8Xk9+xY= github.com/onflow/flow-go-sdk v1.0.0-M6/go.mod h1:aXSavLzoRlz5FiMjcI7p5QhihWScGctxydzf4dv/avo= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 h1:/2vvjKkWG/3cKP3IpgiGNqXi0yskn4GmNTjmeCwMoz8= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a h1:xMEtuQp4+ltfEZcw+4smv4wechSBAus4yEAtPghXZeQ= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240214230837-cd2c42e54b4a/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a h1:Ark2dPAaSxSr45G5WJjB1P5H0tFtXnHcOIp+dM146yo= +github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240214230837-cd2c42e54b4a/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.3.7 h1:+6sBdlE/u4ZMTVB9U1lA6Xn2Bd48lOOX96Bv9dNubsk= github.com/onflow/flow/protobuf/go/flow v0.3.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= diff --git a/integration/utils/templates/create-and-setup-node.cdc b/integration/utils/templates/create-and-setup-node.cdc index 0394e81519c..69932c69066 100644 --- a/integration/utils/templates/create-and-setup-node.cdc +++ b/integration/utils/templates/create-and-setup-node.cdc @@ -1,8 +1,8 @@ import Crypto -import FungibleToken from 0xFUNGIBLETOKENADDRESS -import FlowToken from 0xFLOWTOKENADDRESS +import FungibleToken from "FungibleToken" +import FlowToken from "FlowToken" import FlowIDTableStaking from "FlowIDTableStaking" -import FlowStakingCollection from 0xSTAKINGCOLLECTIONADDRESS +import FlowStakingCollection from "FlowStakingCollection" transaction( stakingAcctKey: Crypto.KeyListEntry, diff --git a/utils/unittest/execution_state.go b/utils/unittest/execution_state.go index 93beaf5e26c..e9452a6b6b6 100644 --- a/utils/unittest/execution_state.go +++ b/utils/unittest/execution_state.go @@ -23,7 +23,7 @@ const ServiceAccountPrivateKeySignAlgo = crypto.ECDSAP256 const ServiceAccountPrivateKeyHashAlgo = hash.SHA2_256 // Pre-calculated state commitment with root account with the above private key -const GenesisStateCommitmentHex = "1b17e01745c8c48efa5bd10cd6edc5f0a9e4a9d708a50d431019ade02a30d861" +const GenesisStateCommitmentHex = "9289842133d059d88ce17cdae58d6a3c02435aff4e89496283c08014bee9ce14" var GenesisStateCommitment flow.StateCommitment @@ -87,10 +87,10 @@ func genesisCommitHexByChainID(chainID flow.ChainID) string { return GenesisStateCommitmentHex } if chainID == flow.Testnet { - return "0bb471053b13ee0f08ca9b9fdb733f6ce8da189e57f473de2db32469f855af3e" + return "5f423e02622a761a860b55c53ed64234d04972d72b65f925d62f55f4cbced039" } if chainID == flow.Sandboxnet { return "e1c08b17f9e5896f03fe28dd37ca396c19b26628161506924fbf785834646ea1" } - return "b037ec65e94310d43b13aab5d0f99af44edac9948a4f17cd4ca797762271630e" + return "24c062634edd1d4b2e8cc6fa3adfffd4d8123cb2283c6ce7627c7f9e6d7bdca8" }