Skip to content

Commit

Permalink
FEATURE: V2 FungibleToken Standard (#131)
Browse files Browse the repository at this point in the history
* draft of v2 standard for working group

* bring FT v2 up to latest design

* adds total supply view and updates dependencies

* update FungibleToken.cdc for Stable Cadence

* integrate stable cadence changes

* comment out events temp

* add view to structs

* use correct import placeholder

* remove view modifier from resolveView

* add default impl for getSupportedVaultTypes

* remove default impl for getsupported

* add Withdrawable to transfer

* remove AnyResource

* update dependencies for stable cadence

* WIP updates to transactions for stable cadence

* comment out default functions and remove Balance

* remove restricted type from link

* Update sdk

* Update contracts

* Update to Cadence v1.0.0-preview.1

* Revert changes to ExampleToken.cdc

* add Cadence test cases for Metadata

* add PrivateReceiverForwarder Cadence tests

* consolidate Cadence test directories

* bump flow CLI version for ci automation

* update go assets

* update utility contracts

* update ExampleToken-v2 Vault to return TotalSupply view

* update ExampleToken-v2 init to publish {FungibleToken.Vault} capability

* update private forwarder transactions for Cadence 1.0

* update tests/scripts for Cadence 1.0

* update go assets

* update go transaction templates

* update transactions for Cadence 1.0

* update scripts for Cadence 1.0

* bump go version

* add public burn method in ExampleToken-v2

* update create_forwarder & generic_transfer txns for Cadence 1.0

* update go assets

* add ReceiverPublicPath to ExampleToken-v2 & update go tests + txns

* update go assets

* update go assets

* rm ExampleToken-v2 dependency on MultipleVaults

* update NonFungibleToken import syntax

* update flow config with up to date dependencies

* update MetadataViews Cadence tests, scripts & txns

* update test_helpers.cdc to Cadence 1.0 syntax

* update PrivateReceiverForwarder Cadence tests

* enable FungibleToken.Receiver.getSupportedVaultTypes() in v2 standard impl

* update switchboard Cadence tests & supporting scripts & txns

* update ExampleToken-v2 Cadence tests

* update go assets

* bump flow cli version to v1.5.0-stable-cadence.3

* fix test script bugs & update go assets

* update example_token_tests

* remove ExampleToken.Minter.mintTokens() pre condition

* add FT.Vault.getDefaultReceiverPath() method

* update ExampleToken.Vault Capability setup & go assets

* rm unused import from ExampleToken-v2

* update NonFungibleToken-v2 implementation from source repo

* fix go GenerateTransferInvalidVaultScript() template txn generation

* rm test bash script in favor of Makefile

* fix example_token_tests burn event check

* Apply suggestions from code review

Co-authored-by: Joshua Hannan <[email protected]>

* update ExampleToken-v2.Vault receiverLinkedType + tests & go assets

* update instances of ExampleToken to ExampleToken-v2 in flow.json & tests

* remove transfer

* remove default implementations and move destroy supply update

* remove transfer event and remove event functions

* remove custom destructor

* add event args, global burn method, balance interface, and clean up tests

* remove path functions and add view function

* remove view modifier, add getIDs

* remove view from data view function, updating forwarding events

* add suport for multiple type definitions

* remove get vault types function and add conformance

* update dependencies and remove getVaultTypes line

* remove burn method

* add burner and add event emission functions

* fix supply update and burner name

* use conditional downcasting

* fix access type

* revert to event emission directly in the pre condition

* update sdk and cadence deps

* fix example token, remove getBalance, add isAvailableToWithdraw

* generate assets

* update transactions to get go tests passing

* add post-condition for vault type

* remove some go tests

* add view functions to Balance and change transactions to use Balance instead of concrete type

* use Balance and FungibleToken.Vault as public interfaces

* use correct linked types

* generate assets

* update generic setup and transfer transactions

* update generic transfer transactions

* update contract borrows and ExampleToken import

* update README for v2 standards

* use correct import placeholder format

* update previewnet address

* update Burner for optional resources and add tests

* revove coverage file

* fix imports for standard transactions

* add switchboard entitlements and tests

* remove old code samples in the README and add links

* add pre-condition to createEmptyVault

* update dependencies

* reorganize txs and scripts

* add type to TokenForwarding

* update comment and event test

* move withdraw event and add balance after params

* make event formatting prettier

* add forwarding addresses

* fix capabilities get in switchboard

* use contract field and mint event

* update CLI and emulator deps and tests

---------

Co-authored-by: Daniel Sainati <[email protected]>
Co-authored-by: Bjarte Stien Karlsen <[email protected]>
Co-authored-by: Supun Setunga <[email protected]>
Co-authored-by: Giovanni Sanchez <[email protected]>
  • Loading branch information
5 people authored May 6, 2024
1 parent 6ec66e1 commit 03372f2
Show file tree
Hide file tree
Showing 98 changed files with 6,075 additions and 4,567 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18.x'
go-version: '1.20.x'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v1.5.0
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/feature/stable-cadence/install.sh)"
- name: Flow CLI Version
run: flow version
run: flow-c1 version
- name: Update PATH
run: echo "/root/.local/bin" >> $GITHUB_PATH
- name: Run tests
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lib/js/test/node_modules/*
node_modules/*
.env
.env
coverage.lcov
coverage.json
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
test:
$(MAKE) generate -C lib/go
$(MAKE) test -C lib/go
flow test --cover --covercode="contracts" tests/*.cdc
flow-c1 test --cover --covercode="contracts" tests/*.cdc

.PHONY: ci
ci:
$(MAKE) ci -C lib/go
flow test --cover --covercode="contracts" tests/*.cdc
flow-c1 test --cover --covercode="contracts" tests/*.cdc
520 changes: 195 additions & 325 deletions README.md

Large diffs are not rendered by default.

Loading

0 comments on commit 03372f2

Please sign in to comment.