Skip to content

Commit 4cce55b

Browse files
committed
add getters for ExampleToken and ExampleNFT
1 parent 3c97234 commit 4cce55b

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

lib/go/contracts/contracts.go

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
_ "github.com/kevinburke/go-bindata"
1010
ftcontracts "github.com/onflow/flow-ft/lib/go/contracts"
11+
"github.com/onflow/flow-go-sdk"
1112
nftcontracts "github.com/onflow/flow-nft/lib/go/contracts"
1213

1314
"github.com/onflow/flow-core-contracts/lib/go/templates"
@@ -361,3 +362,11 @@ func TestFlowFees(fungibleTokenAddress, flowTokenAddress, storageFeesAddress str
361362

362363
return []byte(code)
363364
}
365+
366+
func ExampleToken(env templates.Environment) []byte {
367+
return ftcontracts.ExampleToken(env.FungibleTokenAddress, env.MetadataViewsAddress, env.FungibleTokenMetadataViewsAddress)
368+
}
369+
370+
func ExampleNFT(env templates.Environment) []byte {
371+
return nftcontracts.ExampleNFTWithCrossVMPointers(flow.HexToAddress(env.NonFungibleTokenAddress), flow.HexToAddress(env.MetadataViewsAddress), flow.HexToAddress(env.ViewResolverAddress), flow.HexToAddress(env.EVMAddress), flow.HexToAddress(env.CrossVMMetadataViewsAddress))
372+
}

lib/go/contracts/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ toolchain go1.22.4
66

77
require (
88
github.com/kevinburke/go-bindata v3.24.0+incompatible
9-
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview
9+
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637
1010
github.com/onflow/flow-ft/lib/go/contracts v1.0.1
11+
github.com/onflow/flow-go-sdk v1.0.0-preview.54
1112
github.com/onflow/flow-nft/lib/go/contracts v1.2.3
1213
github.com/stretchr/testify v1.9.0
1314
)
@@ -38,7 +39,6 @@ require (
3839
github.com/onflow/cadence v1.0.0-preview.51 // indirect
3940
github.com/onflow/crypto v0.25.1 // indirect
4041
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
41-
github.com/onflow/flow-go-sdk v1.0.0-preview.54 // indirect
4242
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
4343
github.com/onflow/flow/protobuf/go/flow v0.4.3 // indirect
4444
github.com/onflow/go-ethereum v1.13.4 // indirect

lib/go/contracts/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ github.com/onflow/cadence v1.0.0-preview.51 h1:L+toCS2Sw9bsExc2PxeNMmAK96fn2LdTO
221221
github.com/onflow/cadence v1.0.0-preview.51/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
222222
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
223223
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
224-
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview h1:C0PraQFfwpav4nJAf/RPE9BJyYD6lUMvt+cJyiMDeis=
225-
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
224+
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637 h1:EhhRQDEAc5K3NOtFF+Qd7eXKOToYxEOtSqOtt70ia/Y=
225+
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
226226
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24=
227227
github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
228228
github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=

lib/go/test/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ require (
213213
// replaced by module version in this repo - disregard pinned version
214214
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview
215215
// replaced by module version in this repo - disregard pinned version
216-
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview
216+
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637
217217
)
218218

219219
replace github.com/onflow/flow-core-contracts/lib/go/contracts => ../contracts

0 commit comments

Comments
 (0)