diff --git a/Makefile b/Makefile index 044830f9..e94a78c0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ .PHONY: ci ci: - $(MAKE) -C test ci - $(MAKE) -C contracts ci + $(MAKE) -C lib/go/contracts ci + $(MAKE) -C lib/go/test ci + \ No newline at end of file diff --git a/README.md b/README.md index ae6cef4f..7f9b9bf8 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,11 @@ The feedback we are looking for is: ## Basics of the Standard: -The code for the standard is in `src/contracts/FungibleToken.cdc`. An example implementation of the standard that simulates what a simple token would be like is in `src/contracts/ExampleToken.cdc`. +The code for the standard is in `contracts/FungibleToken.cdc`. An example implementation of the standard that simulates what a simple token would be like is in `contracts/ExampleToken.cdc`. -The exact smart contract that is used for the official Flow Network Token is in `src/contracts/FlowToken.cdc` +The exact smart contract that is used for the official Flow Network Token is in `contracts/FlowToken.cdc` -Example transactions that users could use to interact with fungible tokens are located in the `src/transactions/` directory. -Go transaction templates are in the `test/templates.go` file. These templates are mostly generic and can be used with any fungible token implementation by providing the correct addresses, names, and values. +Example transactions that users could use to interact with fungible tokens are located in the `transactions/` directory. These templates are mostly generic and can be used with any fungible token implementation by providing the correct addresses, names, and values. The standard consists of a contract interface called `FungibleToken` that requires implementing contracts to define a `Vault` resource that represents the tokens that an account owns. Each account that owns tokens will have a `Vault` stored in its account storage. Users call functions on each other's `Vault`s to send and receive tokens. @@ -179,8 +178,8 @@ A standard for token metadata is still an unsolved problem in the general blockc To use the Flow Token contract as is, you need to follow these steps: -1. Deploy the `FungibleToken` definition to account `0x02` -2. Deploy the `ExampleToken` definition to account `0x03` +1. Import the `FungibleToken` definition from account `0xee82856bf20e2aa6`. This is a predeployed interface in the emulator, testnet, and mainnet. +2. Deploy the `ExampleToken` definition 3. You can use the `get_balance.cdc` or `get_supply.cdc` scripts to read the balance of a user's `Vault` or the total supply of all tokens, respectively. 4. Use the `setupAccount.cdc` on any account to set up the account to be able to @@ -195,26 +194,7 @@ To use the Flow Token contract as is, you need to follow these steps: # Running Automated Tests -You can find automated tests in the `fungible_token_test.go` file. It uses the transaction templates that are contained in the `fungible_templates.go` file. Currently, these rely on a dependency from a private dapper labs repository to run, so external users will not be able to run them. We are working on making all of this public so anyone can run tests, but haven't completed this work yet. - - -# Payment ID solution for Custodial Deposits - -We have included a simple example of a contract and resource that could -be used by custodial services to be able to accept deposits from their customers. -This is included in `src/contracts/CustodialDeposit.cdc`. The service would deploy the -contract to their account, which stores the special `DepositResource` -into their storage and published a reference, then users could use transactions -like `src/transactions/custodial_deposit.cdc` to deposit their tokens into the account. -Each deposit has to include a payment ID, or tag as we call it in the contract, to -indicate which account it corresponds to. The resource emits an event that the -service can watch for to see which user's account to credit. - -To test, if you have already deployed `FungibleToken.cdc` and `FlowToken.cdc` to -accounts 1 and 2, respectively: - -1. Deploy `CustodialDeposit.cdc` to account `0x04` -2. Switch to Account `0x03` and submit the `custodial_deposit.cdc` transaction. +You can find automated tests in the `lib/go/test/token_test.go` file. It uses the transaction templates that are contained in the `lib/go/templates/transaction_templates.go` file. Currently, these rely on a dependency from a private dapper labs repository to run, so external users will not be able to run them. We are working on making all of this public so anyone can run tests, but haven't completed this work yet. ## License diff --git a/src/contracts/ExampleToken.cdc b/contracts/ExampleToken.cdc similarity index 100% rename from src/contracts/ExampleToken.cdc rename to contracts/ExampleToken.cdc diff --git a/src/contracts/FungibleToken.cdc b/contracts/FungibleToken.cdc similarity index 100% rename from src/contracts/FungibleToken.cdc rename to contracts/FungibleToken.cdc diff --git a/src/contracts/TokenForwarding.cdc b/contracts/TokenForwarding.cdc similarity index 100% rename from src/contracts/TokenForwarding.cdc rename to contracts/TokenForwarding.cdc diff --git a/contracts/Makefile b/lib/go/contracts/Makefile similarity index 81% rename from contracts/Makefile rename to lib/go/contracts/Makefile index 51608e60..50707f37 100644 --- a/contracts/Makefile +++ b/lib/go/contracts/Makefile @@ -11,4 +11,4 @@ check-generated: git diff --exit-code .PHONY: ci -ci: generate check-generated test +ci: generate test diff --git a/contracts/contracts.go b/lib/go/contracts/contracts.go similarity index 82% rename from contracts/contracts.go rename to lib/go/contracts/contracts.go index 526d58f4..f9f816ef 100644 --- a/contracts/contracts.go +++ b/lib/go/contracts/contracts.go @@ -1,11 +1,11 @@ package contracts -//go:generate go run github.com/kevinburke/go-bindata/go-bindata -prefix ../src/contracts -o internal/assets/assets.go -pkg assets -nometadata -nomemcopy ../src/contracts +//go:generate go run github.com/kevinburke/go-bindata/go-bindata -prefix ../../../contracts -o internal/assets/assets.go -pkg assets -nometadata -nomemcopy ../../../contracts import ( "strings" - "github.com/onflow/flow-ft/contracts/internal/assets" + "github.com/onflow/flow-ft/lib/go/contracts/internal/assets" ) const ( @@ -21,21 +21,6 @@ func FungibleToken() []byte { return assets.MustAsset(fungibleTokenFilename) } -// FlowToken returns the FlowToken contract. -// -// The returned contract will import the FungibleToken interface from the specified address. -func FlowToken(fungibleTokenAddr string) []byte { - code := assets.MustAssetString(flowTokenFilename) - - code = strings.ReplaceAll( - code, - "0x"+defaultFungibleTokenAddress, - "0x"+fungibleTokenAddr, - ) - - return []byte(code) -} - // ExampleToken returns the ExampleToken contract. // // The returned contract will import the FungibleToken interface from the specified address. diff --git a/contracts/contracts_test.go b/lib/go/contracts/contracts_test.go similarity index 83% rename from contracts/contracts_test.go rename to lib/go/contracts/contracts_test.go index c92610a5..7b49470c 100644 --- a/contracts/contracts_test.go +++ b/lib/go/contracts/contracts_test.go @@ -6,7 +6,7 @@ import ( "github.com/onflow/flow-go-sdk" "github.com/stretchr/testify/assert" - "github.com/onflow/flow-ft/contracts" + "github.com/onflow/flow-ft/lib/go/contracts" ) var addrA = flow.HexToAddress("0A") @@ -16,12 +16,6 @@ func TestFungibleTokenContract(t *testing.T) { assert.NotNil(t, contract) } -func TestFlowTokenContract(t *testing.T) { - contract := contracts.FlowToken(addrA.Hex()) - assert.NotNil(t, contract) - assert.Contains(t, string(contract), addrA.Hex()) -} - func TestExampleTokenContract(t *testing.T) { contract := contracts.ExampleToken(addrA.Hex()) assert.NotNil(t, contract) diff --git a/lib/go/contracts/go.mod b/lib/go/contracts/go.mod new file mode 100644 index 00000000..a39c117e --- /dev/null +++ b/lib/go/contracts/go.mod @@ -0,0 +1,12 @@ +module github.com/onflow/flow-ft/lib/go/contracts + +go 1.14 + +require ( + github.com/kevinburke/go-bindata v3.21.0+incompatible // indirect + github.com/onflow/flow-ft/contracts v0.1.3 + github.com/onflow/flow-go-sdk v0.4.0 + github.com/stretchr/testify v1.5.1 +) + +replace github.com/onflow/flow-ft/lib/go/contracts => ../contracts diff --git a/contracts/go.sum b/lib/go/contracts/go.sum similarity index 99% rename from contracts/go.sum rename to lib/go/contracts/go.sum index 8ed99557..1b2eedbf 100644 --- a/contracts/go.sum +++ b/lib/go/contracts/go.sum @@ -95,7 +95,6 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -132,6 +131,7 @@ github.com/onflow/cadence v0.4.0-beta1 h1:0f4CMnddT++5OYY53OPFuv5JTb85qDg/nygLV4 github.com/onflow/cadence v0.4.0-beta1/go.mod h1:gaPtSctdMzT5NAoJgzsRuwUkdgRswVHsRXFNNmCTn3I= github.com/onflow/cadence v0.4.0 h1:oAKY/HclZZhc5wJgJwdPjWXJuC5IjuuHHVAAq3S7AHI= github.com/onflow/cadence v0.4.0/go.mod h1:gaPtSctdMzT5NAoJgzsRuwUkdgRswVHsRXFNNmCTn3I= +github.com/onflow/flow-ft/contracts v0.1.3/go.mod h1:IKe3yEurEKpg/J15q5WBlHkuMmt1iRECSHgnIa1gvRw= github.com/onflow/flow-go-sdk v0.4.0 h1:ZNEE8HQ6xTyr4+RmlxZ2+U/BjKtQDsAB54I+D8AJpZA= github.com/onflow/flow-go-sdk v0.4.0/go.mod h1:MHn8oQCkBNcl2rXdYSm9VYYK4ogwEpyrdM/XK/czdlM= github.com/onflow/flow/protobuf/go/flow v0.1.5-0.20200601215056-34a11def1d6b/go.mod h1:kRugbzZjwQqvevJhrnnCFMJZNmoSJmxlKt6hTGXZojM= diff --git a/contracts/internal/assets/assets.go b/lib/go/contracts/internal/assets/assets.go similarity index 77% rename from contracts/internal/assets/assets.go rename to lib/go/contracts/internal/assets/assets.go index d53f3ec4..2ae1ed69 100644 --- a/contracts/internal/assets/assets.go +++ b/lib/go/contracts/internal/assets/assets.go @@ -1,9 +1,8 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// ../src/contracts/ExampleToken.cdc (7.102kB) -// ../src/contracts/FlowToken.cdc (7.092kB) -// ../src/contracts/FungibleToken.cdc (7.306kB) -// ../src/contracts/TokenForwarding.cdc (2.361kB) +// ../../../contracts/ExampleToken.cdc (7.102kB) +// ../../../contracts/FungibleToken.cdc (7.306kB) +// ../../../contracts/TokenForwarding.cdc (2.361kB) package assets @@ -93,26 +92,6 @@ func exampletokenCdc() (*asset, error) { return a, nil } -var _flowtokenCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x59\x5f\x73\xdb\xb8\x11\x7f\xf7\xa7\xd8\xde\x43\x2b\xcf\xd9\xb2\x1f\x3a\x7d\xf0\x38\x77\x71\x1a\xbb\x93\x69\x9b\x76\x92\x5c\xfb\x6a\x88\x5c\x49\x68\x48\x40\x03\x80\x92\x75\x19\x7f\xf7\xce\x2e\xfe\x10\xa0\x48\xd9\x3e\x5f\xfc\x90\x98\x24\xb0\x7f\x7f\xbb\xfb\x03\x2c\xdb\x8d\x36\x0e\xee\x3a\xb5\x92\x8b\x06\xbf\xe8\xaf\xa8\x60\x69\x74\x0b\x97\x0f\x77\xbf\x7c\xfc\xdb\x87\x77\xff\xb8\xfd\xf2\xaf\xbf\xdf\x7e\xbc\x79\xff\xfe\xd3\xed\xe7\xcf\x27\x27\x9b\x6e\x01\x95\x56\xce\x88\xca\xc1\x5d\xa3\x77\xbc\xe7\x6a\x20\xe2\xdb\xc9\x09\x00\xc0\xc5\x05\x7c\xd1\x4e\x34\x60\xbb\xcd\xa6\xd9\x83\x5e\xf2\x16\x70\xb4\xc8\x82\x54\x80\x0f\xd2\x3a\x54\x15\xf2\x7a\x12\xbe\x15\x06\x1c\x6d\xfa\xcc\x7b\xae\xe0\x97\x3b\xf9\xf0\x97\x3f\x27\x81\xb7\x5b\x54\x0e\xdc\x5a\x38\x90\x16\xb0\x95\xce\x61\x0d\xbb\x35\x2a\x70\x6b\xec\x6d\x93\x16\x2a\x83\xc2\x61\x9d\x44\x23\x6f\x65\x0b\xed\x07\x25\x9d\x14\x8d\xfc\x15\xeb\x99\xf4\xbf\x97\x0a\x4f\x9f\xa5\xd1\x3b\x22\x0c\xc2\x4e\xba\x75\x6d\xc4\x2e\xc4\x4f\xc0\x7f\x44\xd7\xb8\x51\xdd\xff\x8d\x4b\x67\xa2\xd5\x9d\x72\x51\xe5\x19\x6f\xbd\x82\x9b\xba\x36\x68\xed\xcf\x2f\x35\xa1\xc6\x8d\xb6\x92\xbe\x38\x7d\xd4\x80\xf7\x71\xe1\x81\x01\x4e\xbf\x50\xbd\xc2\x5d\x6e\x42\x2b\xd5\x54\xc4\xff\xc9\x9f\x06\x1a\x5f\xee\xa2\x75\x46\xef\x27\x54\xbc\xeb\x8c\xfa\x6d\x2a\x04\x3b\xc2\xd6\x1b\x30\x68\x75\x67\x2a\x9c\xc6\x10\xfb\x62\xfe\xea\xbf\xcd\x44\xd3\xe8\x1d\xd6\x37\xbf\x55\xed\x82\xcc\x7e\x8e\x5a\xf6\x2f\xa9\xed\x35\xf4\x99\xbe\xb8\x48\x5a\x45\xb5\x86\xce\xa2\x01\xeb\xb4\x41\x0b\x42\x81\x54\xd6\x09\x55\x21\x15\xa2\x56\xcd\x9e\x2b\x86\x37\x53\x2d\xba\x35\x4a\xbf\x5a\xac\x30\xd5\xef\x1a\x61\xd9\xa9\xca\x49\xed\x2b\xb6\xdf\x22\x54\x0d\x2b\xbd\x45\x8a\x39\x2c\xbc\xb0\x8d\x41\x7e\xbf\xd1\xd6\x51\x2d\xd6\x92\x37\x46\x69\x52\x0d\x1a\x45\xac\xdb\x3d\x67\xb7\x12\x4d\x83\xf5\x3c\xd7\x5d\xad\xb1\xfa\x6a\x61\x2d\x36\x1b\x8a\x97\x03\xd3\x29\x27\x5b\xe4\x9d\xb8\x45\x03\x22\xd9\xc7\x81\x2b\x44\x44\x49\x9f\x42\x68\xe9\xbb\xf2\xae\x2f\x30\x06\x39\x7a\x45\xad\x03\x1f\x1c\x05\xa7\xe8\x24\x9c\x39\xb2\x31\x4a\xf3\x40\x5c\x4a\xc5\x7b\xcf\xc0\x6a\xfa\x6c\x38\x71\x4a\xc3\x4e\xec\x61\xa9\xc9\xb0\x56\x34\xb2\x92\xba\xb3\x3e\x11\x4e\x07\x95\x3e\x80\x29\x2a\xba\x0b\x4a\xa5\x02\x21\xcd\x1c\x6e\xc0\x6e\xb0\x92\xa2\x09\x40\xeb\xa1\xa1\x10\x6b\x4b\x82\x16\xbd\x09\x4e\x33\x70\xa3\xb4\xbe\x22\x8b\x28\x10\x8a\x92\x18\xd6\x3f\x68\xda\xf3\x7f\x1b\xbd\x95\x35\x9a\xb3\xc1\xfb\x4f\x58\xa1\xdc\x1e\xbe\x7f\x27\x1a\x06\x53\x68\xf6\x41\xfd\x5a\x37\x64\xe1\x1a\x61\x11\xbe\xeb\x25\x08\x0e\x80\x0d\x76\xa5\xe5\xb1\xdf\x87\x95\x65\xaf\x4f\x90\x89\x8d\xba\x10\x4a\x48\x88\xde\x70\x50\x29\xff\x04\x8c\xb4\x97\x36\xce\x06\x92\x4f\xe1\x5b\xfa\x4e\x3f\x16\x9b\xe5\x3c\x8a\x7c\x13\x85\xa7\x25\x8f\x85\x25\xb1\xc3\x67\xef\xf2\xcf\x77\x11\x85\x1e\x2f\xe2\x6b\xac\x39\x87\x2b\x82\x29\x77\x07\x10\xfc\x52\x98\x55\xd7\x62\xc8\x59\x44\x95\xaa\x93\x0a\xeb\x85\x84\x3d\x3c\x50\x52\xdd\xcd\xf3\x4d\x1f\x5c\x80\x94\x0d\xbd\xc4\x21\x8d\x74\x61\xf6\xa1\x48\x63\xdb\xe9\xac\x47\x0a\xa5\x27\x17\x40\x62\x5b\xad\x70\x9f\x56\x2e\x50\xaa\x15\x38\x23\x94\x5d\xa2\x31\x58\xcf\x49\x8b\x41\xd7\x19\xe5\x13\xab\x70\xd7\xec\x73\x21\xb1\x90\x82\x4a\x5d\x94\x13\xcb\xf5\x65\x49\x95\x22\x1d\xd7\xe0\x22\x1b\x57\xb9\x28\x6c\x2c\xee\xa8\x98\xe6\x63\x61\x26\xc0\x2c\x3b\x95\xe2\x34\x6c\xf5\x57\xf0\xb6\xc4\xa8\xb7\xe8\x68\xd2\x8b\xc7\xf3\x10\xf3\x62\x03\xb5\xec\xc9\xd1\xed\xff\x8f\xa3\x9b\x85\xe9\x9d\x42\xf3\xf3\x5c\xf8\x39\x7a\x5a\xc8\xf2\x71\x84\xeb\xf3\xbc\x13\xf4\x30\xf5\xd2\x4e\x27\x10\x18\x22\xf6\x12\x00\x86\x9c\xe8\xc5\xff\xb0\x1a\xa2\x8f\x21\x27\xea\xda\x16\xf5\xe6\x6c\x2a\xb2\x90\xc9\xac\x90\xe9\x91\xdd\xb3\xe3\x60\x94\x16\xc2\x34\xa4\xcd\x61\x5a\xf3\x2e\x4b\x0a\xbd\x31\x0b\xac\x44\x67\xb1\x87\x74\x51\x65\x64\x63\x06\x63\x02\x2c\x9a\xa8\x3b\x34\x36\x1e\x0d\xbc\xf5\x4f\xbd\xb5\x6b\x51\x38\xb2\x40\x54\x04\x42\xdb\xb5\x58\xb3\xab\xdc\xa4\x97\x9a\x07\x4d\x40\x60\x60\x13\xf3\x03\x84\x85\x50\xcf\x7c\x5a\xc7\x50\x35\xec\x25\x0d\x3a\xd8\xb2\x7f\xd7\xe7\x81\x03\xda\x3f\xc0\xdb\xc4\x91\xe7\xa5\xab\x4f\x21\xf1\x47\x2f\x6c\x3e\xec\x49\x03\x40\x1e\x52\xb9\x62\x9b\x67\x74\x4f\xa2\xb2\xd8\x03\x6f\xe0\x72\x7e\x59\x7c\x8f\x89\xdc\x16\x2e\x64\xe0\x0c\x0b\x66\xc3\xa0\xf4\xde\x67\x9c\x1e\xde\x4c\xbc\x3f\x2f\x42\x90\xe9\xc9\xb4\xa5\x76\x73\xdb\x6e\xdc\x7e\x8c\xf9\x94\x75\x50\xb6\x47\x0f\x40\x6a\x1f\x20\x72\x5c\xff\x8a\x46\xa7\xf1\xae\xea\xd4\xee\x64\xdf\xce\x44\xd3\x50\x63\x0c\x6d\x8d\x86\x34\x0f\xf5\xb6\xb3\xbe\xbd\xd1\xfc\xb6\x89\x8b\xe4\xc2\x98\x80\xb1\x10\x2f\x36\x75\xca\x21\xe9\xa2\x17\xda\xd4\x9e\x2a\x70\x1d\xf9\xef\x49\x58\x55\xf1\x40\xf0\xf3\x5f\x2c\x1a\x2e\x51\xe3\xe7\x73\x84\xac\x0d\x5c\x22\x4c\x5b\x70\xfb\x0d\x1e\x30\x01\x82\xf8\x30\x8c\xb3\xa7\xdb\xe7\x13\xdd\xeb\x72\x7e\x79\x9a\xe7\xaa\xe0\x1c\x37\x75\x2b\x95\xb4\xce\x08\xa7\x4d\x26\x33\x25\xf4\x23\xee\x3c\xdd\x79\x56\x7f\x4b\x79\xcd\xb2\x35\xca\xe2\x8f\xcd\x91\x81\xe2\x09\x26\x7f\x05\x6f\x03\x0f\xfb\x76\x58\x86\x47\x8f\x02\xc5\xe3\xf1\x41\x30\x6e\xc1\x84\x80\x72\x2c\x24\x2f\xfc\xf9\xe0\x95\xe1\x1b\x9c\x46\x9e\x15\x3e\xaf\x98\x01\xe4\x7f\x1d\x8b\xd4\xf0\xf4\x72\x2c\x1a\x51\xe0\x64\x0f\xc8\x90\x72\x48\xf3\xe3\xb8\xf3\x83\x90\xab\x40\x10\xfa\x62\x01\xf9\x63\x00\x4d\x96\x48\x9e\x9f\xc5\x9a\x13\x08\x86\x04\x2a\xf0\x34\xaa\x3b\x7f\x54\x8d\x47\x86\x88\xc5\x72\x2c\x26\xb6\x0e\x19\x07\x1e\x85\x5e\xa1\x89\xb6\x7d\x29\x09\xf4\xb1\x0c\xd3\x72\x9b\xf9\x75\xc6\xa3\x9e\xac\x6a\x63\x4f\x73\xd9\xe5\xcc\xd9\x90\x8b\x66\x8c\xaf\x9d\x6a\x82\xc7\xc0\xd1\x9b\x3b\xc6\xd2\xca\xa9\x38\x80\x0b\x9d\x22\xcb\x37\xf4\x13\xa2\xfc\x53\x10\x33\xbb\x3c\xbd\x82\x1f\x7c\xbc\xc2\xbd\x83\x6f\xc6\x0b\x84\x15\xa3\xc8\x50\x20\x14\xf7\xf6\x1f\xa6\xa4\x5d\x87\xb1\x3b\x08\xff\x84\xdc\x06\xad\xf5\x42\x39\xed\x21\xa5\x5e\x54\xa9\xe2\xf1\x15\x63\xf0\xc7\x31\x12\x7a\x68\x25\x8c\x99\xfe\x24\x83\x1d\x5c\xc3\x0c\x09\x27\xbc\x8a\xa3\xf2\x99\x6b\xbc\x89\x8e\x91\xf0\xa1\x3b\xc5\xf3\x41\xe9\xd3\xbf\xb1\xd2\xb3\x4e\xf7\xda\xf2\xa7\x7e\xf7\x64\xe9\xa7\xae\x56\x30\xcc\xce\xa8\x17\x14\x64\xe0\x48\x3d\x29\x8f\xd7\x31\x67\x80\xcb\x25\x56\x4e\x6e\xb1\xd9\xb3\x54\x3e\x81\xf5\x74\x77\x42\xfc\x47\xed\xf0\xca\x33\x74\xcf\x2a\xb2\x8b\x32\xd1\x39\xdd\x0a\x27\xa9\x62\xf7\x60\xbb\x05\xdf\x65\x60\xdd\x1f\x26\x8b\x26\x96\xdf\xd2\x16\x97\x3c\x6c\x74\x57\x39\x6d\x8e\x16\x7b\x1f\x8a\xef\xcb\x98\x69\x8b\x88\x70\x99\x26\xc8\xe3\x7c\x75\x50\x09\x83\xdb\xc2\x43\x58\x67\xe0\xf6\xc0\x26\x10\xdd\x78\x0c\x5d\xc1\x4d\xe7\xd6\xe1\x21\x77\x8c\x81\x5d\x56\x39\xb1\xe9\x3c\xda\x7e\x04\x66\x41\x66\x3e\x3a\x6c\xc8\xd9\x38\x61\x12\x29\xb6\x48\x74\x54\xaa\xe2\x8a\x6e\x90\x8f\x22\xa4\xe3\xe5\x3b\x34\xb0\xf7\x38\xf7\x6f\x4e\xfa\x66\xd7\xe7\x2c\xcc\x9f\x22\x2e\x82\xde\x8b\x65\x4c\x90\xcf\xea\x98\x6f\x82\x90\xd1\xc8\x0a\x2a\xb1\x11\x0b\xd9\x48\xb7\x8f\x33\x84\xd9\x70\x9d\x5f\x4f\xf0\x7d\x1c\x3e\x6c\xb4\x45\x3b\x1c\xad\xf7\x81\xd5\xde\x43\x8b\x6e\xad\xe9\x10\x67\x74\xb7\xf2\xe1\xba\x8f\x57\x53\xf7\x7c\xcd\x62\x96\x62\x9c\xaf\x14\x8e\x35\x52\x7d\xbd\xfe\xe3\x00\x64\xdf\xc6\xaf\xbc\x1e\x7f\x9a\x15\xe8\xb9\xf0\x5e\xf5\x11\x48\x77\x63\xc5\x32\x27\xcc\x0a\xdd\x64\xc4\xd2\xda\xef\x1c\xba\x90\xf2\x7b\x58\x4a\x6c\x06\x91\x7b\x17\xbf\xfd\xbe\x81\x0b\x62\x9f\x8c\x5b\x58\xf7\xea\xb0\x71\x3f\xe0\xde\xde\xe3\xbd\x38\x68\xcc\x8e\xc3\x9b\xdf\x4d\xc1\x9b\x05\x95\x39\xba\xa5\xf6\x21\x54\xb8\x8f\xe7\x14\xd8\xb5\xde\x65\x8c\x2f\x5d\x1b\xef\x84\xcd\x2e\x2f\xfb\x4b\xae\xac\x03\x1d\xf9\x23\xd4\x78\x95\x3e\x9e\x3c\x9e\xfc\x3f\x00\x00\xff\xff\x22\x1a\x70\x0c\xb4\x1b\x00\x00" - -func flowtokenCdcBytes() ([]byte, error) { - return bindataRead( - _flowtokenCdc, - "FlowToken.cdc", - ) -} - -func flowtokenCdc() (*asset, error) { - bytes, err := flowtokenCdcBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "FlowToken.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x83, 0x7e, 0x8, 0xf8, 0xcf, 0x83, 0x81, 0xa1, 0xaf, 0x40, 0x84, 0x75, 0x1a, 0x89, 0x64, 0x9d, 0x36, 0x49, 0x4b, 0x8f, 0x88, 0x10, 0x3d, 0xc3, 0x39, 0x3d, 0x5d, 0x72, 0xe2, 0x10, 0xaf, 0x72}} - return a, nil -} - var _fungibletokenCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x59\x4d\x73\xdc\xb8\x11\xbd\xf3\x57\x74\xd9\x07\xcb\xce\x58\xda\x43\x2a\x07\x57\x79\x13\xbb\xd6\xaa\xf2\x25\x49\x25\x4a\xf6\x3a\x18\xb2\x39\x83\x15\x08\x70\x01\x70\x46\xb4\xcb\xff\x3d\xd5\x8d\x0f\x82\x1c\x4a\x1a\x55\xd6\x17\x6b\x48\xa0\xd1\xdd\x78\xfd\xfa\x01\xbc\x79\xf7\xae\xaa\x5e\xc3\xdd\x01\xe1\x56\x99\x13\xdc\x0e\x7a\x2f\x77\x0a\xe1\xce\xdc\xa3\x06\xe7\x85\x6e\x84\x6d\xaa\xea\xf5\x6b\xd8\xa6\x97\xfc\x6e\x0b\xb5\xd1\xde\x8a\xda\x83\xd4\x1e\x6d\x2b\x6a\xac\x2a\x32\x94\x7f\x82\x3f\x08\x0f\x42\x29\x68\x93\x59\xcf\x66\xd3\x4c\x07\x27\x33\xa8\x06\x0e\xe2\x48\xaf\xe8\x79\x6b\x6c\x07\xde\x5c\x57\x5f\x5b\x10\x30\x38\xb4\x0e\x4e\x42\x7b\x47\xef\x1b\xec\x95\x19\x41\x80\xc6\xd3\xc2\xd4\x06\xfc\x01\xa5\xcd\xbf\xab\x60\x59\x23\x36\x34\x53\x76\xbd\xc2\x0e\xb5\xa7\x61\x30\x0b\x64\xf2\xf7\x9a\xfd\x2f\x8c\x2c\xdc\x6b\x8d\xa2\x1c\x51\x40\x64\xc5\x0e\x0a\x1d\x08\xdd\x80\x16\x9d\xd4\xfb\x8a\xc3\xf5\xb3\x0c\xb8\x1e\x6b\xd9\x4a\x74\xd7\x21\x85\xff\x15\x83\xf2\x5b\xb0\xe8\xcc\x60\x29\x61\x5f\x44\x7d\x00\x51\xd7\x66\x60\xdf\x84\x07\x73\xd2\x2e\x04\x97\xd2\x93\x82\x60\x3f\x04\x39\x4c\xfb\x52\x63\x65\x5a\x5e\x8e\x8d\x66\x9b\xe0\xbc\xb1\xd8\x80\xd4\x31\x25\xc9\x3a\x3d\x17\xfb\x18\xe5\x72\xd2\x41\x38\xe8\xd0\x1f\x4c\xe3\x20\xc7\x61\x4e\x1a\x2d\x47\x68\xfc\x01\x6d\xdc\x8e\x5a\x68\xa8\x85\x52\x31\xa4\x7f\x5a\x73\x94\x0d\xda\xed\x06\xb6\xff\xc2\x1a\xe5\x91\xff\xa6\x59\xdb\xcf\x42\x91\xa3\x53\xc0\x53\x6a\x1c\xbb\xe1\xca\x27\xd0\x60\xad\x84\x45\xe8\x2d\xbe\xaf\x8d\x6e\xa4\x97\x46\x87\x14\xf7\xc6\xf9\xf2\x19\xfb\x68\xd1\x79\x2b\x6b\x5f\x91\xb3\xf8\x80\xf5\x40\x2f\x21\xa6\xa5\x1d\x74\x1d\x06\x87\x54\x84\x90\x43\xf8\x23\xd0\x3a\x0e\x7b\x61\x85\x47\xd8\x61\x2d\x06\xf2\xc5\xc3\x5e\x1e\xd1\xf1\x70\x8a\x96\xff\x10\x3b\xa9\xa4\x1f\x69\x0b\xdc\x41\x58\xac\x04\x58\x6c\xd1\xa2\xae\x19\x17\x21\xcd\x21\xa1\x61\x0b\xb5\x1a\x01\x1f\x7a\xe3\xa2\xa9\x56\xa2\x6a\xdc\xe4\x51\x25\x35\x18\x8d\x60\x2c\x74\xc6\x62\xf2\x78\x4a\xc5\x75\x55\x7d\xa5\xd2\x71\x26\x3a\x14\x52\xbf\xf0\xa6\x13\xf7\x08\xf5\xe0\xbc\xe9\x72\x86\x63\x6a\x32\xe0\x29\x37\xf3\x2c\x53\x21\x19\x38\x0a\x2b\xcd\x40\xa3\xa5\xde\x3b\x38\x49\x7f\x60\xf3\x01\x79\xd7\xd5\xad\xb1\x80\x0f\x82\xcc\x6c\x40\x40\x2b\x86\x1a\x3d\xef\xfd\x0e\x27\xeb\xd8\xc0\x6e\x4c\x75\xcb\x35\xc0\xe9\x80\x04\x8a\x59\x71\x7d\x1e\x61\x70\x52\xef\x0b\x5f\x69\x6b\x27\xd7\x36\x31\x4c\xd3\x2e\x4a\x34\x13\x46\x45\x0e\x38\xd4\x0d\xcf\xb4\x01\x6e\xa9\x5a\x7a\x44\xfb\xde\x9b\xf7\xf4\xff\x86\x23\x32\x83\xa7\xaa\xa1\x35\x89\x04\x68\x21\xe6\x06\x0a\x56\x40\x8d\x64\x55\x81\xc2\x66\x8f\x16\x5c\x27\xac\xcf\x4b\x5d\xc3\x9d\x09\x2b\x45\xeb\xde\x80\xd0\x53\x1d\x6c\xaa\x40\x4f\xb1\x46\x1d\xa5\x64\xe4\x45\x1b\x2b\x4e\x45\x2a\xa1\xb5\xa6\x2b\x31\xc2\x54\x15\x4a\x88\x81\xdb\x60\x6f\x9c\xf4\x19\x1d\x60\xf4\x6c\xa5\x37\x2e\x61\x8b\x18\x92\x32\xef\x31\xd8\xb7\x42\xbb\x16\xed\x75\x55\xbd\xbb\xa9\xaa\x9b\x1b\xe6\xf1\x4e\x48\xbd\xe4\xf1\x62\x17\x6e\x6e\xe0\x1f\x6c\xfa\x71\x4e\x96\x4a\xcd\x08\x53\xba\x82\xe2\x6f\x6e\xaa\x7e\xd8\xad\x90\xff\x62\xcb\xbe\x57\x15\x00\x40\x74\xca\x1b\x2f\x14\xe8\xa1\xdb\xa1\x65\xb4\x87\xd4\x48\x0d\xf8\x20\x9d\xa7\x4a\xba\x4e\xe3\xbf\x7a\x90\x0e\x86\x3e\x96\x56\x01\x36\x4b\x8f\x50\xbb\xc1\xc6\xde\x12\xcc\xba\xa1\xef\xd5\x98\xa6\x3b\x2f\x46\x47\xa4\x37\x70\x69\x13\x4e\x82\xad\x46\x78\xe4\x41\xe4\xff\x51\xd8\x30\xfb\xdf\x3c\xf9\x03\xfc\xe7\x56\x3e\xfc\xe5\xcf\xd9\xe9\x2f\x47\x4c\x84\x2c\x1d\x60\x27\x3d\x61\xfd\x44\x1b\x47\x3e\x4d\xe1\x3b\xa8\x2d\x0a\x8f\x4d\x36\x8d\x3c\x95\xb3\xe0\xbe\x6a\xe9\xa5\x50\xf2\x1b\x36\x57\x32\xfc\x3d\x5f\xf0\xed\x45\x2b\x86\x6c\x11\x65\x25\x80\xe9\x00\x2b\x11\xa0\xb1\xba\xf6\xaf\x69\xe8\x95\xe8\xa8\x01\xa4\x25\x37\x3c\xf5\x03\x7c\x6a\x1a\x8b\xce\xfd\xf5\xa5\x2e\x44\xbc\x86\x9e\xf4\x94\x03\xbf\xa4\x81\x67\x0e\x78\xb3\xb6\x7c\x22\x8d\xf8\x3b\xe3\x61\xae\x27\x90\xb8\xa6\x8e\xc4\x6a\xf1\xf7\x41\x5a\x46\x87\x83\xd6\xd8\x9c\x1f\xe2\xa2\x38\x7f\x51\x86\x13\x9e\x98\x16\xc6\x3e\x23\x2f\x4d\xf8\x15\xa1\x31\xfa\x4d\x5e\x6a\xbe\x8a\xd1\xb0\xdd\xa5\xbe\x76\x40\x8b\x9b\x34\xaf\xe8\x22\x0a\x05\xb1\xb6\xe9\x23\x5e\x7a\xe3\x9c\x8c\xc4\x6d\xda\x00\x19\x5a\x3e\x92\x77\x1f\x23\x77\xd9\x67\x8a\x34\x38\xa1\xb1\x46\xe7\x84\x95\x6a\x8c\x4a\x80\xa9\xc4\x9c\x34\x44\x37\x66\xfe\xd3\x26\x9c\x77\xdb\x89\x90\x63\x5d\xc6\x75\x52\xba\x8a\x67\xe5\xeb\xdb\x44\x49\xec\x8f\x1b\x76\x91\x22\x96\x29\x65\xa1\x90\x78\xaa\x34\x10\x58\xda\x0f\x96\xb0\xb3\xd4\x1c\xb9\xe7\x58\xec\xcc\x11\x9b\xdc\x7b\xd6\x9d\xb9\x2b\x7a\xfa\x1b\xae\x70\x74\x0e\x14\x1e\x51\x11\x5c\xfb\x61\xa7\x64\xbd\x81\xdd\x90\x38\xcb\x51\xfa\x04\x25\x77\xa7\xb0\x2b\x4d\xa5\x9d\xe2\x46\x3d\x29\x1d\x6e\x2e\xde\x58\x06\x06\xfb\x95\xf3\x38\xd7\x52\xa5\xad\x9a\x15\x19\x97\xb6\x1a\x99\xd5\xc3\xf2\xc9\xd5\xa7\xc2\x09\xcb\x76\x62\x84\xbd\x15\xda\x47\x99\x15\x17\xc9\x21\x52\x87\x4d\x80\xa1\x70\xe4\x31\x31\x59\x76\xa1\xcf\xaa\x80\x36\x2a\xb4\x24\xc1\x6a\x35\x2a\xd0\x7a\x26\xe1\xa8\x70\xd9\x76\x69\x85\x71\x9a\x60\x92\x43\xf7\x07\x6b\x86\x3d\xb5\xcb\xac\x79\x2e\x8b\x28\x88\x17\x0e\x8b\x72\xf2\x4c\x50\xbc\x79\x97\xc6\x44\xf6\x56\xc3\x99\xc5\x50\x5a\x7b\x71\x38\x54\x46\xed\xa0\x73\x81\x2c\x28\xec\xed\x07\xf8\x5b\x40\xf3\xf7\x3c\x85\xa7\x19\xb7\x7c\x14\x3d\xd8\x5a\x74\x51\xfb\xb7\xd1\xe7\x00\x31\x2a\x0e\x38\x0a\x35\xe0\xd9\xb4\x30\xe5\x3a\x96\x39\x7c\xfc\x08\xd1\x8b\xb3\x91\xf4\xef\x55\x22\x7c\xa1\xe2\x38\xe8\x06\xe7\x49\xaf\xd1\x4a\x4e\x74\x08\x22\xa4\x28\x59\x8c\xba\x73\x6a\x2a\x1c\xd3\xab\x99\xf9\x1f\xd5\xfc\xaf\x1f\x99\xaf\x93\xda\xff\x7f\xf8\x3a\x36\x93\x73\xba\x96\x7a\xd9\xfe\x9f\xa5\x6b\xa9\x6b\x35\x34\x48\xca\x2e\x1d\x14\x82\x0b\xf5\x01\xeb\xfb\x79\xe4\x91\x01\x92\x8d\x13\xf2\x29\x93\x76\x85\xf4\xf6\x25\x72\x3b\xc4\x1e\xe4\x76\x55\x70\x41\x63\xd2\x98\x75\x69\xbd\x01\x25\xef\xe9\x64\xa8\x24\x9f\xb2\x3a\x92\x27\x42\x37\x59\xbf\xb0\xe6\xa4\xe7\xa4\x59\x64\xcb\x28\xf5\xd0\xab\x70\x2e\x80\x67\xa9\x3e\x6d\xcb\x82\xea\x63\xa6\x2f\x62\xfa\x28\xf3\x89\xcc\x42\x9b\x4f\x1a\x35\x84\x50\x4e\x5c\xdf\xa7\xa9\xde\xc6\x1e\x9f\xaa\xaf\x68\xf8\x2a\x48\x92\x50\x53\x6f\x97\x45\x65\x71\xa5\xa6\x68\x46\x2e\x8d\x9f\x63\x5d\x5e\xfd\xf4\xf6\x91\xe2\x88\x62\x24\x03\x20\x95\x46\x80\xdf\x11\x2f\x05\x7d\x3c\xd2\x3e\x8d\x79\x92\x87\x42\xea\x80\xa0\x49\x2d\xf0\x31\x10\xca\x53\x7b\x9a\x4f\x7d\xb2\x28\x14\xe2\x3b\x52\x5d\x1a\x4f\x61\xdc\x9b\x20\xbd\xa2\xd4\xdc\x94\x50\x4e\x26\x58\xa5\x67\xb5\x09\xb5\xb1\x16\x6b\xaf\xc6\x4b\x20\x13\x83\x5a\x20\x66\x12\xee\x0b\xbe\x88\x5c\xfe\xc6\x2d\xf1\x90\x94\x75\x1c\x3f\x57\xd5\xf4\x8f\x3c\xbc\x5a\xbc\x3d\xdb\xee\x75\x0e\x75\xa8\xda\x92\x0a\x93\x95\xf5\xed\xfe\xbc\xd8\xe6\x32\x35\x09\xb0\xe1\x51\x32\x74\x29\x00\xca\x7d\x2b\x8f\x38\x45\x8b\x59\x22\x60\xba\x89\xf0\xe6\xb1\xd3\xeb\x92\xd5\xee\xf8\x64\x58\x2b\x61\x45\xba\xd4\x60\x5e\xab\x2d\x1f\xff\xc6\x9e\x55\x89\x58\x3b\x88\x75\x28\xf4\x9c\x97\xf0\x88\x76\x5c\x1e\x0a\xf3\xcc\xf9\x85\x81\x5b\x9e\xf8\xa2\x0d\xce\x64\x83\xad\xd4\x58\x7a\x12\xba\xa0\xd9\xfd\x86\xd1\x52\xe6\xc2\x70\x29\x90\x3b\xdd\x65\x17\x45\xc5\xfd\x50\x51\x1a\x91\xd9\x39\x9b\x2e\x5f\xa7\xd0\x9b\xe9\x4a\xe5\x31\x94\xb3\x83\x1f\xb2\x00\xde\x64\x7e\xdc\x14\xb0\x7f\x01\xea\x5f\x0e\xfa\x68\x74\xba\x25\x09\xdb\x17\x13\x1a\xae\xbc\x26\x11\x29\xbf\xcd\xa5\x4b\xba\x44\x35\x27\x47\xda\x8f\xa2\x48\xfa\x74\x81\xe0\xe4\xe8\x71\xa1\xc2\x9f\xae\xbe\xd5\xf3\x40\xa1\xf5\xb7\x41\x4b\x6c\x27\xb5\xcf\xf6\x5d\x5e\x35\xf5\x2e\x48\x52\x2b\xc9\xfd\x63\x09\x8d\xdc\x05\x93\x65\x6c\x66\x0c\x06\x7f\x8c\xfe\x5a\x6d\x15\x33\xea\xf8\xf9\x19\x15\xf5\x29\x48\xa7\x49\x13\x25\x0a\x51\x41\x60\x0a\x0d\xc6\x02\xfe\x3e\x08\x15\x7e\xad\x08\xaa\x27\x65\x14\x3c\xa9\x13\xe9\x58\xc2\x69\x22\xdd\x2e\xd4\x74\x2b\xb4\xdd\x61\x6b\x2c\x6e\x59\xa3\xa0\x8f\x3b\xa1\x86\xbc\xe8\xa2\xcf\xac\x19\x8f\xf7\xba\x3b\xdc\x4b\xad\x09\x45\x8b\xab\xd2\xe9\x12\x75\x65\xf6\xf3\x8c\xcc\x0e\x5e\x95\x8f\xdf\xc2\xfb\xa7\xb3\xfd\xf7\xd4\xe1\xce\x1a\x33\x5f\x8d\x45\xf9\x33\x65\xb6\xb7\x78\xe4\x7b\xcb\x02\x7d\x2f\xd3\xb0\x2b\x9a\x08\xbc\xb8\xc7\x33\xc4\x0a\x7a\xd2\x0b\x2b\x3a\xf4\xf1\x1a\x5c\x34\xcd\x5c\xfc\x14\x65\x10\x69\x6e\x81\x84\x78\x19\xff\x68\x49\xbe\x48\x07\x5d\xd8\x18\xd7\xb6\xe1\x4f\xe9\x71\x29\x9b\x1e\xd3\x4a\x4f\x6f\x8a\x1b\xba\x67\x77\x63\xba\x23\x7a\xd1\x89\x22\xe8\x9b\x2f\x5d\xef\xc7\xb5\x36\xfb\x49\x8f\xe1\xce\x35\x7d\x82\x98\x9f\xb4\xf9\x82\x94\x2d\xc4\x4f\x44\x65\x6f\x9a\xdd\xac\x1c\xc4\xe4\xf2\xc7\x8f\xf0\xd3\xb2\x79\xd0\x8e\x2c\x7d\xb9\x5a\xe3\x9c\x95\x2d\x39\x3f\xb4\x4d\xd2\x14\x5e\x51\x23\xd0\x78\x52\x63\xd2\x72\xd1\x49\x4e\x30\x7f\xe0\xf9\x86\xd6\x9c\x6b\x92\x94\xa9\x1f\xf1\x9e\x57\xba\xa9\x7f\x97\x32\x41\x3a\xf8\x8d\x4d\xa1\x65\x48\x86\x03\xf3\x50\x7e\x3e\x3b\xfb\x02\x56\x85\x6e\xbd\x94\x11\x62\x67\x8e\xb8\xc9\x77\x25\xe7\x23\xf8\x53\x90\x36\x0c\x8c\x60\x1b\x1b\xb2\x65\x74\x71\x47\x15\x29\xa7\x33\xfc\x31\x62\x79\x7b\xfc\xcb\xd0\x75\x23\x7c\xff\x51\xc1\xff\x02\x00\x00\xff\xff\xb9\x57\xa9\xfb\x8a\x1c\x00\x00" func fungibletokenCdcBytes() ([]byte, error) { @@ -245,7 +224,6 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "ExampleToken.cdc": exampletokenCdc, - "FlowToken.cdc": flowtokenCdc, "FungibleToken.cdc": fungibletokenCdc, "TokenForwarding.cdc": tokenforwardingCdc, } @@ -295,7 +273,6 @@ type bintree struct { var _bintree = &bintree{nil, map[string]*bintree{ "ExampleToken.cdc": &bintree{exampletokenCdc, map[string]*bintree{}}, - "FlowToken.cdc": &bintree{flowtokenCdc, map[string]*bintree{}}, "FungibleToken.cdc": &bintree{fungibletokenCdc, map[string]*bintree{}}, "TokenForwarding.cdc": &bintree{tokenforwardingCdc, map[string]*bintree{}}, }} diff --git a/lib/go/templates/Makefile b/lib/go/templates/Makefile new file mode 100644 index 00000000..6cd994a9 --- /dev/null +++ b/lib/go/templates/Makefile @@ -0,0 +1,14 @@ +.PHONY: test +test: + go test ./... + +.PHONY: generate +generate: + go generate + +.PHONY: check-generated +check-generated: + git diff --exit-code + +.PHONY: ci +ci: generate check-generated test \ No newline at end of file diff --git a/contracts/go.mod b/lib/go/templates/go.mod similarity index 83% rename from contracts/go.mod rename to lib/go/templates/go.mod index a6b7a4f2..9509f79d 100644 --- a/contracts/go.mod +++ b/lib/go/templates/go.mod @@ -1,4 +1,4 @@ -module github.com/onflow/flow-ft/contracts +module github.com/onflow/flow-ft/lib/go/templates go 1.14 @@ -15,3 +15,5 @@ require ( golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e // indirect gopkg.in/yaml.v2 v2.2.8 // indirect ) + +replace github.com/onflow/flow-ft/lib/go/templates => ../templates diff --git a/lib/go/templates/go.sum b/lib/go/templates/go.sum new file mode 100644 index 00000000..437dd8ad --- /dev/null +++ b/lib/go/templates/go.sum @@ -0,0 +1,275 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/antlr/antlr4 v0.0.0-20191217191749-ff67971f8580/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= +github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f h1:0cEys61Sr2hUBEXfNV8eyQP01oZuBgoMeHunebPirK8= +github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.9.9/go.mod h1:a9TqabFudpDu1nucId+k9S8R9whYaHnGBLKFouA5EAo= +github.com/ethereum/go-ethereum v1.9.13 h1:rOPqjSngvs1VSYH2H+PMPiWt4VEulvNRbFgqiGqJM3E= +github.com/ethereum/go-ethereum v1.9.13/go.mod h1:qwN9d1GLyDh0N7Ab8bMGd0H9knaji2jOBm2RrMGjXls= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fxamacker/cbor/v2 v2.2.0 h1:6eXqdDDe588rSYAi1HfZKbx6YYQO4mxQ9eC6xYpU/JQ= +github.com/fxamacker/cbor/v2 v2.2.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.5 h1:AKODKU3pDH1RzZzm6YZu77YWtEAq6uh1rLIAQlay2qc= +github.com/go-test/deep v1.0.5/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g= +github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onflow/cadence v0.4.0-beta1/go.mod h1:gaPtSctdMzT5NAoJgzsRuwUkdgRswVHsRXFNNmCTn3I= +github.com/onflow/cadence v0.4.0 h1:oAKY/HclZZhc5wJgJwdPjWXJuC5IjuuHHVAAq3S7AHI= +github.com/onflow/cadence v0.4.0/go.mod h1:gaPtSctdMzT5NAoJgzsRuwUkdgRswVHsRXFNNmCTn3I= +github.com/onflow/flow-go-sdk v0.4.0 h1:ZNEE8HQ6xTyr4+RmlxZ2+U/BjKtQDsAB54I+D8AJpZA= +github.com/onflow/flow-go-sdk v0.4.0/go.mod h1:MHn8oQCkBNcl2rXdYSm9VYYK4ogwEpyrdM/XK/czdlM= +github.com/onflow/flow-nft v0.0.0-20200604231300-11f405c02451 h1:PjsGUBVJW0vQGgMjZrRSpT0BP1oxUF9B6moNyzmONW0= +github.com/onflow/flow/protobuf/go/flow v0.1.5-0.20200601215056-34a11def1d6b/go.mod h1:kRugbzZjwQqvevJhrnnCFMJZNmoSJmxlKt6hTGXZojM= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/raviqqe/hamt v0.0.0-20190615202029-864fb7caef85 h1:FG/cFwuZM0j3eEBI5jkkYRn6RufVzcvtTXN+YFHWJjI= +github.com/raviqqe/hamt v0.0.0-20190615202029-864fb7caef85/go.mod h1:I9elsTaXMhu41qARmzefHy7v2KmAV2TB1yH4E+nBSf0= +github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/robertkrimen/otto v0.0.0-20170205013659-6a77b7cbc37d/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/segmentio/fasthash v1.0.1/go.mod h1:tm/wZFQ8e24NYaBGIlnO2WGCAi67re4HHuOm0sftE/M= +github.com/segmentio/fasthash v1.0.2 h1:86fGDl2hB+iSHYlccB/FP9qRGvLNuH/fhEEFn6gnQUs= +github.com/segmentio/fasthash v1.0.2/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo= +go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 h1:IaQbIIB2X/Mp/DKctl6ROxz1KyMlKp4uyvL6+kQ7C88= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 h1:5B6i6EAiSYyejWfvc5Rc9BbI3rzIsrrXfAQBWnYfn+w= +golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e h1:ssd5ulOvVWlh4kDSUF2SqzmMeWfjmwDXM+uGw/aQjRE= +golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/lib/go/templates/internal/assets/assets.go b/lib/go/templates/internal/assets/assets.go new file mode 100644 index 00000000..c653691b --- /dev/null +++ b/lib/go/templates/internal/assets/assets.go @@ -0,0 +1,344 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// ../../../transactions/mint_nft.cdc (636B) +// ../../../transactions/read_nft_data.cdc (563B) +// ../../../transactions/setup_account.cdc (610B) +// ../../../transactions/transfer_nft.cdc (553B) + +package assets + +import ( + "bytes" + "compress/gzip" + "crypto/sha256" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) + +func bindataRead(data, name string) ([]byte, error) { + gz, err := gzip.NewReader(strings.NewReader(data)) + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + + var buf bytes.Buffer + _, err = io.Copy(&buf, gz) + + if err != nil { + return nil, fmt.Errorf("read %q: %w", name, err) + } + + clErr := gz.Close() + if clErr != nil { + return nil, clErr + } + + return buf.Bytes(), nil +} + +type asset struct { + bytes []byte + info os.FileInfo + digest [sha256.Size]byte +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _mint_nftCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x91\xc1\x8e\xa2\x40\x10\x86\xef\x3c\x45\xad\x87\x0d\x5c\x70\xcf\x66\xd5\x10\x94\xdb\xb2\x13\xe5\x05\x9a\xb6\xc4\xce\x34\xdd\x9d\xa2\x98\x71\x62\x7c\xf7\x49\xb7\x08\x8e\xb1\x0f\x90\xc0\xd7\x5f\xfe\xbf\x4a\xb5\xce\x12\x43\x69\x4d\xd1\x9b\x46\xd5\x1a\x2b\xfb\x8e\x06\x8e\x64\x5b\xf8\x73\x2e\x8b\x2a\xdb\x6c\x76\xdb\xfd\x3e\x1a\xc8\xed\x59\xb4\x4e\x63\x59\x54\x0f\x4c\xfe\xbf\xac\x76\x59\x3e\xb2\x51\xc4\x24\x4c\x27\x24\x2b\x6b\x62\x42\xa9\x9c\x42\xc3\x0b\xc8\x0e\x07\xc2\xae\x4b\xe0\x12\x01\x00\x84\x87\x46\x86\x56\x19\x46\x5a\xc0\xef\x49\x9f\x96\x45\xf5\x2f\x7c\x8e\x02\xe6\x08\x9d\x20\x8c\x3b\xd5\x18\x8f\x66\x3d\x9f\x32\x29\x6d\x6f\xd8\xeb\x02\xe3\x4f\x87\xfa\x98\xde\x7c\xb0\x84\x1b\x9d\xd6\x96\xc8\x7e\xfe\x7d\xa9\x5f\xc5\xbe\xc8\x02\xe6\x1d\x5b\x12\x0d\xce\xc7\x3f\xc9\xaf\x60\xbd\xde\xe4\x78\x46\xd9\x33\x0e\xd1\xef\xc9\xc7\x72\xb0\x84\x06\x79\x48\x34\x75\x4e\xa2\x67\x1c\xd5\x47\x88\x36\x22\x23\xe0\x4f\xda\x20\xe7\xc2\x89\x5a\x69\xc5\x5f\xf1\xdc\xf5\xb5\x56\xd2\x67\xca\xad\xd6\x18\x26\x3a\xe4\x1a\xaf\xdc\xdb\x5d\x9e\xd7\x98\x4e\x77\xde\x82\xe7\xba\x8a\x93\x1f\x77\xd7\x6b\x70\xc2\x28\x19\xcf\x72\xdb\xeb\x03\x18\xcb\xbe\xc6\x94\x93\xf0\x88\x84\x46\x22\xb0\x05\x3e\x21\xf8\xcd\x4f\xda\x59\xf2\x72\xf2\xe1\x55\x16\xd5\xe3\xee\xef\xca\x64\x18\xea\xf5\x3b\x00\x00\xff\xff\x86\xbd\x57\x55\x7c\x02\x00\x00" + +func mint_nftCdcBytes() ([]byte, error) { + return bindataRead( + _mint_nftCdc, + "mint_nft.cdc", + ) +} + +func mint_nftCdc() (*asset, error) { + bytes, err := mint_nftCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "mint_nft.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x65, 0xec, 0xdd, 0x1a, 0x3a, 0xef, 0x7, 0x4d, 0x38, 0x64, 0x96, 0x68, 0x68, 0xbc, 0xad, 0xa3, 0x9, 0xc5, 0x46, 0xa7, 0x58, 0xd2, 0x4c, 0xa5, 0x5a, 0x4e, 0x91, 0xe7, 0x8b, 0x7f, 0xf0, 0x54}} + return a, nil +} + +var _read_nft_dataCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x91\xc1\x6e\xa3\x30\x10\x86\xef\x3c\xc5\x9f\xcb\x2e\x5c\xc2\xae\xb4\xda\x43\xb4\x59\x89\x26\xa1\xea\x85\x56\x09\x7d\x00\x63\x86\xc4\x2d\xd8\xc8\x1e\x2b\xa9\xa2\xbc\x7b\x05\x01\x12\xb5\xdc\xd0\x7c\xff\xcc\x7c\x63\xd5\xb4\xc6\x32\x32\xa3\x53\xaf\xf7\xaa\xa8\x29\x37\xef\xa4\x51\x59\xd3\xe0\xd7\x29\x4b\xf3\x64\xbd\xde\x6e\x76\xbb\x60\x20\x37\x27\xd1\xb4\x35\x65\x69\x7e\xc7\xac\x9e\xb3\x7c\x9b\xac\x26\x36\x88\x63\xe4\x07\xe5\xe0\xa4\x55\x2d\xc3\x92\x28\x1d\x1a\x62\x51\x0a\x16\x10\x85\xf1\x0c\xa1\xd1\x75\x51\x1a\x02\xde\x91\xfd\xe9\x20\x4d\x5d\x93\x64\x65\x74\xd0\xfa\x02\x95\xd7\x68\x84\xd2\xa1\x90\xd2\x78\xcd\x0b\x24\x65\x69\xc9\xb9\x68\x81\xd7\x27\xcd\x7f\xff\xe0\x1c\x04\x00\x10\xc7\x78\x24\x06\x1f\x08\xad\x2f\x6a\x25\x31\x44\x60\x8a\x37\x92\x0c\x53\xf5\x45\x73\xd4\x64\xc7\x1f\xee\x4c\xfb\x78\x4d\x3c\x94\x96\xd8\x13\x27\xd7\xec\x38\x36\x0a\x26\xe8\xb6\xe0\x83\xb1\xd6\x1c\xb1\xbc\xe6\x7a\xa0\xfb\xe6\x7b\xe2\x95\x68\x45\xa1\x6a\xc5\x1f\x61\x7c\xdd\x26\xee\x6e\x34\x45\xa3\xd9\x0d\x2f\xfa\x36\xff\x7e\x9c\xbf\xbe\xc0\xfc\xc6\xbf\xf4\x3d\x2e\xff\xc3\x68\x36\xd9\x0e\xe3\x05\x2c\x55\x64\x49\xcb\x4e\x07\x02\xae\x25\xa9\x2a\x25\xc7\xd3\x76\x9e\x77\x57\x1d\x3d\x74\xc5\x58\x7e\xb3\x19\xb6\xc9\xd2\x3c\x54\xe5\x02\xbf\x07\x71\x4b\xec\xad\xee\x32\x73\x55\x06\x97\xcf\x00\x00\x00\xff\xff\x27\x05\x12\x73\x33\x02\x00\x00" + +func read_nft_dataCdcBytes() ([]byte, error) { + return bindataRead( + _read_nft_dataCdc, + "read_nft_data.cdc", + ) +} + +func read_nft_dataCdc() (*asset, error) { + bytes, err := read_nft_dataCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "read_nft_data.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x19, 0x91, 0x2e, 0xdb, 0x50, 0x62, 0xf7, 0xef, 0xd9, 0x4, 0x67, 0x3c, 0xa4, 0xf9, 0xda, 0x7c, 0x2f, 0xb, 0xf9, 0x8b, 0xae, 0xaa, 0xe6, 0x65, 0x47, 0x9, 0xf0, 0x1b, 0x7c, 0xc8, 0x22, 0x94}} + return a, nil +} + +var _setup_accountCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x91\xcf\x6e\xf2\x30\x10\xc4\xef\x7e\x8a\xf9\x2e\x28\x48\x40\xbe\x33\x0a\xa8\x11\x90\x63\x5a\x41\x5e\xc0\xb8\x0b\x58\x38\x76\x64\x6f\x80\x0a\xf1\xee\x55\x42\x0b\xa1\x2d\x7b\xb0\xfc\x67\xfc\x9b\x1d\x5b\x97\x95\xf3\x8c\xdc\xd9\xac\xb6\x5b\xbd\x36\x54\xb8\x3d\x59\x6c\xbc\x2b\xf1\xff\x94\x67\x45\x3a\x9f\x2f\x17\xab\x95\xf8\x52\x2e\x4e\xb2\xac\x0c\xe5\x59\xd1\xd1\xcc\x5e\xf3\x62\x99\xce\x6e\xda\x38\x46\xb1\xd3\x01\xec\xa5\x0d\x52\xb1\x76\x16\x3a\xe0\xb8\x93\x0c\x69\x21\x95\x72\xb5\x65\x1c\x5d\x6d\xde\xe1\x6b\xdb\x5c\x60\x87\x40\x0c\xcd\x81\xcc\x06\x75\xd5\x6c\x78\x52\xa4\x0f\x84\x3c\x2b\x82\x10\x5d\xda\x59\x00\x40\xe5\xa9\x92\x9e\x22\xa9\x14\x8f\x91\xd6\xbc\x4b\xaf\xe8\x3e\xce\xa2\x55\x34\xa5\x37\x8d\x23\x8f\xd6\xce\x7b\x77\x4c\x7a\xf7\x08\xa3\x99\x33\x86\x5a\xe2\x34\x6a\xe2\x8c\x11\x07\x76\x5e\x6e\x29\x6e\x62\xdd\x4e\xfb\x98\x4c\x60\xb5\xe9\x62\x9b\x32\xc4\x50\x37\x15\x92\x61\xe7\x7d\x46\xca\x93\x64\x5a\x94\x15\x7f\xdc\x49\x51\x1f\x32\xfc\xc3\xcb\x9f\x4d\x3c\xb0\x1f\x16\x6d\x80\x20\x0f\x14\x25\xc3\xbb\xe1\x00\xec\x9e\xb6\x2c\x7e\x03\x8c\xb6\xfb\xa4\x77\xfe\xf9\xdb\x9d\x0e\xde\xea\xb5\xd1\xea\x32\x8d\xe2\xaa\x9d\x3d\x32\x07\x60\xe9\xb7\xc4\xcf\x3d\xbf\xed\x2e\xe2\x3a\x5e\xc4\x67\x00\x00\x00\xff\xff\xf9\x8c\x1f\x1f\x62\x02\x00\x00" + +func setup_accountCdcBytes() ([]byte, error) { + return bindataRead( + _setup_accountCdc, + "setup_account.cdc", + ) +} + +func setup_accountCdc() (*asset, error) { + bytes, err := setup_accountCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "setup_account.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x63, 0xd4, 0x4, 0x5f, 0x75, 0x3c, 0xf0, 0x3d, 0x1b, 0xcb, 0x9a, 0x32, 0x26, 0xc7, 0xe8, 0xeb, 0x7e, 0xab, 0xa7, 0xa6, 0xeb, 0x34, 0x1e, 0x16, 0x42, 0xd6, 0x38, 0x10, 0x77, 0x35, 0xe4, 0x85}} + return a, nil +} + +var _transfer_nftCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x91\x41\x6f\x82\x40\x10\x85\xef\xfc\x8a\xf1\xd2\x2c\x49\xc5\x1e\x9a\x1e\x88\x9a\x10\xd4\xc4\x0b\x6d\x94\xfe\x80\x65\x19\x70\xd3\x75\x77\xb3\x0c\xd1\xc6\xf8\xdf\x1b\xac\x2e\x20\xa7\x49\xf8\xe6\xcd\x7b\x6f\xe5\xd1\x1a\x47\x90\x19\xbd\x69\x75\x2d\x0b\x85\xb9\xf9\x41\x0d\x95\x33\x47\x78\x3b\x67\x9b\x3c\x59\xad\x76\xeb\xfd\x3e\xb8\x93\xeb\x33\x3f\x5a\x85\xd9\x26\x1f\x30\xe9\x67\x96\xef\x92\xd4\xb3\x01\x39\xae\x1b\x2e\x48\x1a\xcd\x1c\x0a\x69\x25\x6a\x8a\x21\x29\x4b\x87\x4d\xf3\x0a\x27\x49\x87\xd2\xf1\xd3\x76\x15\xc3\xf7\x56\xd3\xc7\x7b\x08\x97\x00\x00\xc0\x3a\xb4\xdc\x21\xe3\x42\x74\x0b\x2d\x1d\x12\x21\x4c\xab\xe9\x01\x74\x9f\x42\x02\x2f\x0b\x0b\xa8\x91\xee\x54\x7f\x2d\x0c\x46\xb8\x30\x4a\xe1\xcd\xd0\x0e\x2b\x58\x40\xa7\x1f\x15\xc6\x39\x73\x9a\xbf\xf4\xa1\xa2\xd4\x73\x4b\xd6\x05\x8c\x61\xd6\x90\x71\xbc\xc6\x59\x17\xd4\xff\x0d\x27\x23\xf9\x12\xad\x69\x24\xfd\x6b\x7b\x0f\x51\x8d\x94\x72\xcb\x0b\xa9\x24\xfd\xb2\x99\x6d\x0b\x25\xc5\xb3\x90\xb7\x71\x79\x7e\x86\x81\x9b\xaf\xdb\xea\x75\xc9\xc2\xc9\x38\x98\xae\x08\xe6\xd3\x71\xbe\xe8\xd1\x2f\x1b\x16\xdd\xcf\x83\x6e\x7a\xe3\xd1\x7d\x64\xd4\x9d\x8e\x61\x3e\xd5\x15\x85\x37\xf0\x1a\x5c\xff\x02\x00\x00\xff\xff\x93\x21\xc1\xd5\x29\x02\x00\x00" + +func transfer_nftCdcBytes() ([]byte, error) { + return bindataRead( + _transfer_nftCdc, + "transfer_nft.cdc", + ) +} + +func transfer_nftCdc() (*asset, error) { + bytes, err := transfer_nftCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transfer_nft.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe2, 0x50, 0x26, 0x21, 0x3e, 0x36, 0x40, 0xfa, 0x93, 0x33, 0xd5, 0xc3, 0xc5, 0xab, 0x7d, 0x66, 0x74, 0x89, 0x15, 0xa7, 0xf3, 0xbd, 0xbb, 0x82, 0xb2, 0xc5, 0xad, 0xe8, 0xb7, 0xdb, 0x8c, 0x52}} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "mint_nft.cdc": mint_nftCdc, + "read_nft_data.cdc": read_nft_dataCdc, + "setup_account.cdc": setup_accountCdc, + "transfer_nft.cdc": transfer_nftCdc, +} + +// AssetDebug is true if the assets were built with the debug flag enabled. +const AssetDebug = false + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "mint_nft.cdc": &bintree{mint_nftCdc, map[string]*bintree{}}, + "read_nft_data.cdc": &bintree{read_nft_dataCdc, map[string]*bintree{}}, + "setup_account.cdc": &bintree{setup_accountCdc, map[string]*bintree{}}, + "transfer_nft.cdc": &bintree{transfer_nftCdc, map[string]*bintree{}}, +}} + +// RestoreAsset restores an asset under the given directory. +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) +} + +// RestoreAssets restores an asset under the given directory recursively. +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) +} diff --git a/lib/go/templates/script_templates.go b/lib/go/templates/script_templates.go new file mode 100644 index 00000000..4bb960b4 --- /dev/null +++ b/lib/go/templates/script_templates.go @@ -0,0 +1,57 @@ +package templates + +//go:generate go run github.com/kevinburke/go-bindata/go-bindata -prefix ../../../scripts -o internal/assets/assets.go -pkg assets -nometadata -nomemcopy ../../../scripts + +import ( + "fmt" + + "github.com/onflow/flow-go-sdk" +) + +const ( + readDataFilename = "get_balance.cdc" +) + +// GenerateInspectVaultScript creates a script that retrieves a +// Vault from the array in storage and makes assertions about +// its balance. If these assertions fail, the script panics. +func GenerateInspectVaultScript(fungibleAddr, tokenAddr, userAddr flow.Address, tokenName string, expectedBalance float64) []byte { + storageName := MakeFirstLowerCase(tokenName) + + template := ` + import FungibleToken from 0x%[1]s + import %[3]s from 0x%[2]s + + pub fun main() { + let acct = getAccount(0x%[5]s) + let vaultRef = acct.getCapability(/public/%[4]sBalance)!.borrow<&%[3]s.Vault{FungibleToken.Balance}>() + ?? panic("Could not borrow Balance reference to the Vault") + assert( + vaultRef.balance == UFix64(%[6]f), + message: "incorrect balance!" + ) + } + ` + + return []byte(fmt.Sprintf(template, fungibleAddr, tokenAddr, tokenName, storageName, userAddr, expectedBalance)) +} + +// GenerateInspectSupplyScript creates a script that reads +// the total supply of tokens in existence +// and makes assertions about the number +func GenerateInspectSupplyScript(fungibleAddr, tokenAddr flow.Address, tokenName string, expectedSupply int) []byte { + + template := ` + import FungibleToken from 0x%[1]s + import %[3]s from 0x%[2]s + + pub fun main() { + assert( + %[3]s.totalSupply == UFix64(%[4]d), + message: "incorrect totalSupply!" + ) + } + ` + + return []byte(fmt.Sprintf(template, fungibleAddr, tokenAddr, tokenName, expectedSupply)) +} diff --git a/test/templates.go b/lib/go/templates/transaction_templates.go similarity index 83% rename from test/templates.go rename to lib/go/templates/transaction_templates.go index 4fa5996b..ada9aeea 100644 --- a/test/templates.go +++ b/lib/go/templates/transaction_templates.go @@ -1,7 +1,9 @@ -package test +package templates import ( + "bytes" "fmt" + "strings" "github.com/onflow/flow-go-sdk" ) @@ -196,50 +198,6 @@ func GenerateTransferInvalidVaultScript(fungibleAddr, tokenAddr, otherTokenAddr, return []byte(fmt.Sprintf(template, fungibleAddr, tokenName, tokenAddr, otherTokenName, otherTokenAddr, receiverAddr, storageName, otherStorageName, amount)) } -// GenerateInspectVaultScript creates a script that retrieves a -// Vault from the array in storage and makes assertions about -// its balance. If these assertions fail, the script panics. -func GenerateInspectVaultScript(fungibleAddr, tokenAddr, userAddr flow.Address, tokenName string, expectedBalance float64) []byte { - storageName := MakeFirstLowerCase(tokenName) - - template := ` - import FungibleToken from 0x%[1]s - import %[3]s from 0x%[2]s - - pub fun main() { - let acct = getAccount(0x%[5]s) - let vaultRef = acct.getCapability(/public/%[4]sBalance)!.borrow<&%[3]s.Vault{FungibleToken.Balance}>() - ?? panic("Could not borrow Balance reference to the Vault") - assert( - vaultRef.balance == UFix64(%[6]f), - message: "incorrect balance!" - ) - } - ` - - return []byte(fmt.Sprintf(template, fungibleAddr, tokenAddr, tokenName, storageName, userAddr, expectedBalance)) -} - -// GenerateInspectSupplyScript creates a script that reads -// the total supply of tokens in existence -// and makes assertions about the number -func GenerateInspectSupplyScript(fungibleAddr, tokenAddr flow.Address, tokenName string, expectedSupply int) []byte { - - template := ` - import FungibleToken from 0x%[1]s - import %[3]s from 0x%[2]s - - pub fun main() { - assert( - %[3]s.totalSupply == UFix64(%[4]d), - message: "incorrect totalSupply!" - ) - } - ` - - return []byte(fmt.Sprintf(template, fungibleAddr, tokenAddr, tokenName, expectedSupply)) -} - // GenerateCreateForwarderScript creates a script that instantiates // a new forwarder instance in an account func GenerateCreateForwarderScript(fungibleAddr, forwardingAddr, receiverAddr flow.Address, tokenName string) []byte { @@ -266,3 +224,18 @@ func GenerateCreateForwarderScript(fungibleAddr, forwardingAddr, receiverAddr fl ` return []byte(fmt.Sprintf(template, fungibleAddr, forwardingAddr, storageName, receiverAddr)) } + +// MakeFirstLowerCase makes the first letter in a string lowercase +func MakeFirstLowerCase(s string) string { + + if len(s) < 2 { + return strings.ToLower(s) + } + + bts := []byte(s) + + lc := bytes.ToLower([]byte{bts[0]}) + rest := bts[1:] + + return string(bytes.Join([][]byte{lc, rest}, nil)) +} diff --git a/test/Makefile b/lib/go/test/Makefile similarity index 100% rename from test/Makefile rename to lib/go/test/Makefile diff --git a/lib/go/test/go.mod b/lib/go/test/go.mod new file mode 100644 index 00000000..0a27d887 --- /dev/null +++ b/lib/go/test/go.mod @@ -0,0 +1,17 @@ +module github.com/onflow/flow-ft/lib/go/test + +go 1.13 + +require ( + github.com/dapperlabs/flow-emulator v0.4.0 + github.com/onflow/cadence v0.4.0 + github.com/onflow/flow-ft/contracts v0.1.3 + github.com/onflow/flow-ft/lib/go/contracts v0.1.3 + github.com/onflow/flow-ft/lib/go/templates v0.0.0-00010101000000-000000000000 + github.com/onflow/flow-go-sdk v0.4.1 + github.com/onflow/flow/protobuf/go/flow v0.1.5-0.20200611205353-548107cc9aca // indirect + github.com/stretchr/testify v1.6.1 +) + +replace github.com/onflow/flow-ft/lib/go/contracts => ../contracts +replace github.com/onflow/flow-ft/lib/go/templates => ../templates diff --git a/test/go.sum b/lib/go/test/go.sum similarity index 99% rename from test/go.sum rename to lib/go/test/go.sum index a85bffac..9c0a1cb9 100644 --- a/test/go.sum +++ b/lib/go/test/go.sum @@ -454,8 +454,11 @@ github.com/onflow/cadence v0.4.1-0.20200604185918-21edaa9bfcdd/go.mod h1:dgj1JPl github.com/onflow/cadence v0.4.1-0.20200619225610-580db8360a67 h1:ht7Fxjg3lYAdixgbzhyXrq040Usv4K7vzzJHRoSyAjI= github.com/onflow/cadence v0.4.1-0.20200619225610-580db8360a67/go.mod h1:dgj1JPlSDeY6ZSqD/yCW06reFSt+19d/IFgQ1eE8Bfg= github.com/onflow/flow v0.1.4-0.20200601215056-34a11def1d6b/go.mod h1:lzyAYmbu1HfkZ9cfnL5/sjrrsnJiUU8fRL26CqLP7+c= +github.com/onflow/flow-ft v0.1.2 h1:DlnffFsNNSuK6bTwmQwIeutFKds0XIf8JYQ1TDd6bc8= github.com/onflow/flow-ft/contracts v0.0.0-20200525235630-0e8024a483ce h1:I8SaLOFlQN7Jr+aU1mZB0mnsq2qlaaJPeji4PmkTWfA= github.com/onflow/flow-ft/contracts v0.0.0-20200525235630-0e8024a483ce/go.mod h1:KwzrK5thiLObKHTHaHf9lrvOS3HLr9jntNEZUQ4yJgw= +github.com/onflow/flow-ft/contracts v0.1.3 h1:KLszm8wQE1is92NYro76nGaQKfHw20G9H404cLn4uP4= +github.com/onflow/flow-ft/contracts v0.1.3/go.mod h1:IKe3yEurEKpg/J15q5WBlHkuMmt1iRECSHgnIa1gvRw= github.com/onflow/flow-go-sdk v0.3.0-beta1 h1:HmAqosPHLoNmYfhUECsSFpvSD4kWIkJ+Xs8LAJijKDc= github.com/onflow/flow-go-sdk v0.3.0-beta1/go.mod h1:8v6vcYGh5/PtYcM3IXflLcCb00I91WDbnNF8SjirnlI= github.com/onflow/flow-go-sdk v0.4.0 h1:ZNEE8HQ6xTyr4+RmlxZ2+U/BjKtQDsAB54I+D8AJpZA= diff --git a/test/test.go b/lib/go/test/test.go similarity index 88% rename from test/test.go rename to lib/go/test/test.go index 02d3c5c1..2004248d 100644 --- a/test/test.go +++ b/lib/go/test/test.go @@ -1,9 +1,7 @@ package test import ( - "bytes" "io/ioutil" - "strings" "testing" "github.com/onflow/flow-go-sdk/crypto" @@ -101,18 +99,3 @@ func readFile(path string) []byte { } return contents } - -// MakeFirstLowerCase makes the first letter in a string lowercase -func MakeFirstLowerCase(s string) string { - - if len(s) < 2 { - return strings.ToLower(s) - } - - bts := []byte(s) - - lc := bytes.ToLower([]byte{bts[0]}) - rest := bts[1:] - - return string(bytes.Join([][]byte{lc, rest}, nil)) -} diff --git a/test/token_test.go b/lib/go/test/token_test.go similarity index 66% rename from test/token_test.go rename to lib/go/test/token_test.go index 886a6991..6caa1c7d 100644 --- a/test/token_test.go +++ b/lib/go/test/token_test.go @@ -10,7 +10,8 @@ import ( "github.com/onflow/flow-go-sdk/crypto" "github.com/onflow/flow-go-sdk/test" - "github.com/onflow/flow-ft/contracts" + "github.com/onflow/flow-ft/lib/go/contracts" + "github.com/onflow/flow-ft/lib/go/templates" ) func TestTokenDeployment(t *testing.T) { @@ -22,7 +23,7 @@ func TestTokenDeployment(t *testing.T) { fungibleAddr, exampleTokenAddr, _ := DeployTokenContracts(b, t, []*flow.AccountKey{exampleTokenAccountKey}) t.Run("Should have initialized Supply field correctly", func(t *testing.T) { - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) } @@ -39,7 +40,7 @@ func TestCreateToken(t *testing.T) { t.Run("Should be able to create empty Vault that doesn't affect supply", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). + SetScript(templates.GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -52,9 +53,9 @@ func TestCreateToken(t *testing.T) { false, ) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) } @@ -71,7 +72,7 @@ func TestExternalTransfers(t *testing.T) { // then deploy the tokens to an account tx := flow.NewTransaction(). - SetScript(GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). + SetScript(templates.GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -87,7 +88,7 @@ func TestExternalTransfers(t *testing.T) { t.Run("Shouldn't be able to deposit an empty Vault", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)). + SetScript(templates.GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -101,14 +102,14 @@ func TestExternalTransfers(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) }) t.Run("Shouldn't be able to withdraw more than the balance of the Vault", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 30000)). + SetScript(templates.GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 30000)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -122,14 +123,14 @@ func TestExternalTransfers(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) }) t.Run("Should be able to withdraw and deposit tokens from a vault", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). + SetScript(templates.GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -143,17 +144,17 @@ func TestExternalTransfers(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 700)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 700)) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) t.Run("Should be able to transfer tokens through a forwarder from a vault", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateCreateForwarderScript(fungibleAddr, forwardingAddr, exampleTokenAddr, "ExampleToken")). + SetScript(templates.GenerateCreateForwarderScript(fungibleAddr, forwardingAddr, exampleTokenAddr, "ExampleToken")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -167,7 +168,7 @@ func TestExternalTransfers(t *testing.T) { ) tx = flow.NewTransaction(). - SetScript(GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). + SetScript(templates.GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -181,11 +182,11 @@ func TestExternalTransfers(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 700)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 700)) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) } @@ -202,7 +203,7 @@ func TestVaultDestroy(t *testing.T) { // then deploy the tokens to an account tx := flow.NewTransaction(). - SetScript(GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). + SetScript(templates.GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -216,7 +217,7 @@ func TestVaultDestroy(t *testing.T) { ) tx = flow.NewTransaction(). - SetScript(GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). + SetScript(templates.GenerateTransferVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 300)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -231,7 +232,7 @@ func TestVaultDestroy(t *testing.T) { t.Run("Should subtract tokens from supply when they are destroyed", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateDestroyVaultScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 100)). + SetScript(templates.GenerateDestroyVaultScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 100)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -245,14 +246,14 @@ func TestVaultDestroy(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 600)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 600)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 900)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 900)) }) t.Run("Should subtract tokens from supply when they are destroyed by a different account", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateDestroyVaultScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 100)). + SetScript(templates.GenerateDestroyVaultScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 100)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -266,9 +267,9 @@ func TestVaultDestroy(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 200)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 200)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 800)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 800)) }) } @@ -286,7 +287,7 @@ func TestMintingAndBurning(t *testing.T) { // then deploy the tokens to an account tx := flow.NewTransaction(). - SetScript(GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). + SetScript(templates.GenerateCreateTokenScript(fungibleAddr, exampleTokenAddr, "ExampleToken")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -301,7 +302,7 @@ func TestMintingAndBurning(t *testing.T) { t.Run("Shouldn't be able to mint zero tokens", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)). + SetScript(templates.GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -315,17 +316,17 @@ func TestMintingAndBurning(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) t.Run("Shouldn't be able to mint more than the allowed amount", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 101)). + SetScript(templates.GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 101)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -339,17 +340,17 @@ func TestMintingAndBurning(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 0)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) t.Run("Should mint tokens, deposit, and update balance and total supply", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 50)). + SetScript(templates.GenerateMintTokensScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 50)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -363,17 +364,17 @@ func TestMintingAndBurning(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 1000)) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 50)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, joshAddress, "ExampleToken", 50)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1050)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1050)) }) t.Run("Should burn tokens and update balance and total supply", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateBurnTokensScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 50)). + SetScript(templates.GenerateBurnTokensScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 50)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -387,9 +388,9 @@ func TestMintingAndBurning(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 950)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, exampleTokenAddr, exampleTokenAddr, "ExampleToken", 950)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, exampleTokenAddr, "ExampleToken", 1000)) }) } @@ -457,7 +458,7 @@ func TestCreateCustomToken(t *testing.T) { t.Run("Should be able to create empty Vault that doesn't affect supply", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateCreateTokenScript(fungibleAddr, tokenAddr, "UtilityCoin")). + SetScript(templates.GenerateCreateTokenScript(fungibleAddr, tokenAddr, "UtilityCoin")). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -470,14 +471,14 @@ func TestCreateCustomToken(t *testing.T) { false, ) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 0)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 0)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1000)) }) t.Run("Should mint tokens, deposit, and update balance and total supply", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateMintTokensScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 50)). + SetScript(templates.GenerateMintTokensScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 50)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -491,17 +492,17 @@ func TestCreateCustomToken(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, tokenAddr, tokenAddr, "UtilityCoin", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, tokenAddr, tokenAddr, "UtilityCoin", 1000)) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 50)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, tokenAddr, joshAddress, "UtilityCoin", 50)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1050)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1050)) }) t.Run("Shouldn't be able to transfer token from a vault to a differenly typed vault", func(t *testing.T) { tx := flow.NewTransaction(). - SetScript(GenerateTransferInvalidVaultScript(fungibleAddr, tokenAddr, badTokenAddr, badTokenAddr, "UtilityCoin", "BadCoin", 20)). + SetScript(templates.GenerateTransferInvalidVaultScript(fungibleAddr, tokenAddr, badTokenAddr, badTokenAddr, "UtilityCoin", "BadCoin", 20)). SetGasLimit(100). SetProposalKey(b.ServiceKey().Address, b.ServiceKey().ID, b.ServiceKey().SequenceNumber). SetPayer(b.ServiceKey().Address). @@ -515,12 +516,12 @@ func TestCreateCustomToken(t *testing.T) { ) // Assert that the vaults' balances are correct - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, tokenAddr, tokenAddr, "UtilityCoin", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, tokenAddr, tokenAddr, "UtilityCoin", 1000)) - executeScriptAndCheck(t, b, GenerateInspectVaultScript(fungibleAddr, badTokenAddr, badTokenAddr, "BadCoin", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectVaultScript(fungibleAddr, badTokenAddr, badTokenAddr, "BadCoin", 1000)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1050)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, tokenAddr, "UtilityCoin", 1050)) - executeScriptAndCheck(t, b, GenerateInspectSupplyScript(fungibleAddr, badTokenAddr, "BadCoin", 1000)) + executeScriptAndCheck(t, b, templates.GenerateInspectSupplyScript(fungibleAddr, badTokenAddr, "BadCoin", 1000)) }) } diff --git a/src/scripts/get_balance.cdc b/scripts/get_balance.cdc similarity index 100% rename from src/scripts/get_balance.cdc rename to scripts/get_balance.cdc diff --git a/src/scripts/get_supply.cdc b/scripts/get_supply.cdc similarity index 100% rename from src/scripts/get_supply.cdc rename to scripts/get_supply.cdc diff --git a/src/contracts/FlowToken.cdc b/src/contracts/FlowToken.cdc deleted file mode 100644 index 60fcbdda..00000000 --- a/src/contracts/FlowToken.cdc +++ /dev/null @@ -1,198 +0,0 @@ -import FungibleToken from 0xFUNGIBLETOKENADDRESS - -pub contract FlowToken: FungibleToken { - - // Total supply of Flow tokens in existence - pub var totalSupply: UFix64 - - // Event that is emitted when the contract is created - pub event TokensInitialized(initialSupply: UFix64) - - // Event that is emitted when tokens are withdrawn from a Vault - pub event TokensWithdrawn(amount: UFix64, from: Address?) - - // Event that is emitted when tokens are deposited to a Vault - pub event TokensDeposited(amount: UFix64, to: Address?) - - // Event that is emitted when new tokens are minted - pub event TokensMinted(amount: UFix64) - - // Event that is emitted when tokens are destroyed - pub event TokensBurned(amount: UFix64) - - // Event that is emitted when a new minter resource is created - pub event MinterCreated(allowedAmount: UFix64) - - // Event that is emitted when a new burner resource is created - pub event BurnerCreated() - - // Vault - // - // Each user stores an instance of only the Vault in their storage - // The functions in the Vault and governed by the pre and post conditions - // in FungibleToken when they are called. - // The checks happen at runtime whenever a function is called. - // - // Resources can only be created in the context of the contract that they - // are defined in, so there is no way for a malicious user to create Vaults - // out of thin air. A special Minter resource needs to be defined to mint - // new tokens. - // - pub resource Vault: FungibleToken.Provider, FungibleToken.Receiver, FungibleToken.Balance { - - // holds the balance of a users tokens - pub var balance: UFix64 - - // initialize the balance at resource creation time - init(balance: UFix64) { - self.balance = balance - } - - // withdraw - // - // Function that takes an integer amount as an argument - // and withdraws that amount from the Vault. - // It creates a new temporary Vault that is used to hold - // the money that is being transferred. It returns the newly - // created Vault to the context that called so it can be deposited - // elsewhere. - // - pub fun withdraw(amount: UFix64): @FungibleToken.Vault { - self.balance = self.balance - amount - emit TokensWithdrawn(amount: amount, from: self.owner?.address) - return <-create Vault(balance: amount) - } - - // deposit - // - // Function that takes a Vault object as an argument and adds - // its balance to the balance of the owners Vault. - // It is allowed to destroy the sent Vault because the Vault - // was a temporary holder of the tokens. The Vault's balance has - // been consumed and therefore can be destroyed. - pub fun deposit(from: @FungibleToken.Vault) { - let vault <- from as! @FlowToken.Vault - self.balance = self.balance + vault.balance - emit TokensDeposited(amount: vault.balance, to: self.owner?.address) - vault.balance = 0.0 - destroy vault - } - - destroy() { - FlowToken.totalSupply = FlowToken.totalSupply - self.balance - } - } - - // createEmptyVault - // - // Function that creates a new Vault with a balance of zero - // and returns it to the calling context. A user must call this function - // and store the returned Vault in their storage in order to allow their - // account to be able to receive deposits of this token type. - // - pub fun createEmptyVault(): @FungibleToken.Vault { - return <-create Vault(balance: 0.0) - } - - pub resource Administrator { - // createNewMinter - // - // Function that creates and returns a new minter resource - // - pub fun createNewMinter(allowedAmount: UFix64): @Minter { - emit MinterCreated(allowedAmount: allowedAmount) - return <-create Minter(allowedAmount: allowedAmount) - } - - // createNewBurner - // - // Function that creates and returns a new burner resource - // - pub fun createNewBurner(): @Burner { - emit BurnerCreated() - return <-create Burner() - } - } - - // Minter - // - // Resource object that token admin accounts can hold to mint new tokens. - // - pub resource Minter { - - // the amount of tokens that the minter is allowed to mint - pub var allowedAmount: UFix64 - - // mintTokens - // - // Function that mints new tokens, adds them to the total supply, - // and returns them to the calling context. - // - pub fun mintTokens(amount: UFix64): @FlowToken.Vault { - pre { - amount > UFix64(0): "Amount minted must be greater than zero" - amount <= self.allowedAmount: "Amount minted must be less than the allowed amount" - } - FlowToken.totalSupply = FlowToken.totalSupply + amount - self.allowedAmount = self.allowedAmount - amount - emit TokensMinted(amount: amount) - return <-create Vault(balance: amount) - } - - init(allowedAmount: UFix64) { - self.allowedAmount = allowedAmount - } - } - - // Burner - // - // Resource object that token admin accounts can hold to burn tokens. - // - pub resource Burner { - - // burnTokens - // - // Function that destroys a Vault instance, effectively burning the tokens. - // - // Note: the burned tokens are automatically subtracted from the - // total supply in the Vault destructor. - // - pub fun burnTokens(from: @FungibleToken.Vault) { - let vault <- from as! @FlowToken.Vault - let amount = vault.balance - destroy vault - emit TokensBurned(amount: amount) - } - } - - init(adminAccount: AuthAccount) { - self.totalSupply = 0.0 - - // Create the Vault with the total supply of tokens and save it in storage - // - let vault <- create Vault(balance: self.totalSupply) - adminAccount.save(<-vault, to: /storage/flowTokenVault) - - // Create a public capability to the stored Vault that only exposes - // the `deposit` method through the `Receiver` interface - // - adminAccount.link<&FlowToken.Vault{FungibleToken.Receiver}>( - /public/flowTokenReceiver, - target: /storage/flowTokenVault - ) - - // Create a public capability to the stored Vault that only exposes - // the `balance` field through the `Balance` interface - // - adminAccount.link<&FlowToken.Vault{FungibleToken.Balance}>( - /public/flowTokenBalance, - target: /storage/flowTokenVault - ) - - let admin <- create Administrator() - adminAccount.save(<-admin, to: /storage/flowTokenAdmin) - - // Emit an event that shows that the contract was initialized - emit TokensInitialized(initialSupply: self.totalSupply) - } -} diff --git a/test/go.mod b/test/go.mod deleted file mode 100644 index 699ea375..00000000 --- a/test/go.mod +++ /dev/null @@ -1,14 +0,0 @@ -module github.com/onflow/flow-ft/test - -go 1.13 - -require ( - github.com/dapperlabs/flow-emulator v0.4.0 - github.com/onflow/cadence v0.4.0 - github.com/onflow/flow-ft/contracts v0.0.0-20200525235630-0e8024a483ce - github.com/onflow/flow-go-sdk v0.4.1 - github.com/onflow/flow/protobuf/go/flow v0.1.5-0.20200611205353-548107cc9aca // indirect - github.com/stretchr/testify v1.6.1 -) - -replace github.com/onflow/flow-ft/contracts => ../contracts diff --git a/src/transactions/burn_tokens.cdc b/transactions/burn_tokens.cdc similarity index 100% rename from src/transactions/burn_tokens.cdc rename to transactions/burn_tokens.cdc diff --git a/src/transactions/create_forwarder.cdc b/transactions/create_forwarder.cdc similarity index 100% rename from src/transactions/create_forwarder.cdc rename to transactions/create_forwarder.cdc diff --git a/src/transactions/mint_tokens.cdc b/transactions/mint_tokens.cdc similarity index 100% rename from src/transactions/mint_tokens.cdc rename to transactions/mint_tokens.cdc diff --git a/src/transactions/setup_account.cdc b/transactions/setup_account.cdc similarity index 100% rename from src/transactions/setup_account.cdc rename to transactions/setup_account.cdc diff --git a/src/transactions/transfer_tokens.cdc b/transactions/transfer_tokens.cdc similarity index 100% rename from src/transactions/transfer_tokens.cdc rename to transactions/transfer_tokens.cdc