Skip to content

Commit

Permalink
add getters for ExampleToken and ExampleNFT
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Feb 26, 2025
1 parent 3c97234 commit 4cce55b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions lib/go/contracts/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

_ "github.com/kevinburke/go-bindata"
ftcontracts "github.com/onflow/flow-ft/lib/go/contracts"
"github.com/onflow/flow-go-sdk"
nftcontracts "github.com/onflow/flow-nft/lib/go/contracts"

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

return []byte(code)
}

func ExampleToken(env templates.Environment) []byte {
return ftcontracts.ExampleToken(env.FungibleTokenAddress, env.MetadataViewsAddress, env.FungibleTokenMetadataViewsAddress)
}

func ExampleNFT(env templates.Environment) []byte {
return nftcontracts.ExampleNFTWithCrossVMPointers(flow.HexToAddress(env.NonFungibleTokenAddress), flow.HexToAddress(env.MetadataViewsAddress), flow.HexToAddress(env.ViewResolverAddress), flow.HexToAddress(env.EVMAddress), flow.HexToAddress(env.CrossVMMetadataViewsAddress))
}
4 changes: 2 additions & 2 deletions lib/go/contracts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ toolchain go1.22.4

require (
github.com/kevinburke/go-bindata v3.24.0+incompatible
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637
github.com/onflow/flow-ft/lib/go/contracts v1.0.1
github.com/onflow/flow-go-sdk v1.0.0-preview.54
github.com/onflow/flow-nft/lib/go/contracts v1.2.3
github.com/stretchr/testify v1.9.0
)
Expand Down Expand Up @@ -38,7 +39,6 @@ require (
github.com/onflow/cadence v1.0.0-preview.51 // indirect
github.com/onflow/crypto v0.25.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-go-sdk v1.0.0-preview.54 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.3 // indirect
github.com/onflow/go-ethereum v1.13.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions lib/go/contracts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ github.com/onflow/cadence v1.0.0-preview.51 h1:L+toCS2Sw9bsExc2PxeNMmAK96fn2LdTO
github.com/onflow/cadence v1.0.0-preview.51/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview h1:C0PraQFfwpav4nJAf/RPE9BJyYD6lUMvt+cJyiMDeis=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637 h1:EhhRQDEAc5K3NOtFF+Qd7eXKOToYxEOtSqOtt70ia/Y=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637/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=
Expand Down
2 changes: 1 addition & 1 deletion lib/go/test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ require (
// replaced by module version in this repo - disregard pinned version
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview
// replaced by module version in this repo - disregard pinned version
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637
)

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

0 comments on commit 4cce55b

Please # to comment.