brew install flow-cli
sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
iex "& { $(irm 'https://raw.githubusercontent.com/onflow/flow-cli/master/install.ps1') }"
Do the following command and follow the instructions:
flow accounts create
Change the testnet-account
key in this file to the account name you have set.
flow project deploy --network testnet
⚠️ Assuming your account name istestnet-account
.
publicKey: String
signatureAlgorithm: UInt8
hashAlgorithm: UInt8
creationFee: UFix64
publicKey
: Public key of the account as a hexadecimal stringsignatureAlgorithm
: Signature algorithm forPublicKey
as raw data
Algorithm | Raw data |
---|---|
ECDSA_P256 | 1 |
ECDSA_secp256k1 | 2 |
BLS_BLS12_381 | 3 |
Note: New Cadence
enum
type has raw data starting from0
instead of1
.
Thus, it would be increased/decreased by 1 in the code logic to avoid mismatching forFactory.PubKey
.
hashAlgorithm
: Hash algorithm forAccountKey
as raw data
Algorithm | Raw data |
---|---|
SHA2_256 | 1 |
SHA2_384 | 2 |
SHA3_256 | 3 |
SHA3_384 | 4 |
KMAC128_BLS_BLS12_381 | 5 |
KECCAK_256 | 6 |
Note: New Cadence
enum
type has raw data starting from0
instead of1
.
Thus, it would be increased/decreased by 1 in the code logic to avoid mismatching forFactory.Key
.
creationFee
: Creation fee for the account, minimum is0.001
FLOW
flow transactions send './transactions/1. Create Account.cdc' \
--signer testnet-account \
--network testnet \
--args-json '[
{
"type": "String",
"value": "2ca8f4e4d35917a25f909f738b114201468b2ea0b60ebe2cdd9b6ed3eb25717340e12ac97fbf4efa66f3f45f4673127c9d9f717e40ee4c0aac1dea42ae9db3e4"
},
{ "type": "UInt8", "value": "1" },
{ "type": "UInt8", "value": "1" },
{ "type": "UFix64", "value": "0.001" }
]'
flow transactions send './transactions/2. Setup FUSD.cdc' \
--signer testnet-account \
--network testnet \
--args-json '[]'
flow transactions send './transactions/3. Setup USDC.cdc' \
--signer testnet-account \
--network testnet \
--args-json '[]'
to: Address
amount: UFix64
vaultPath: StoragePath
receiverPath: PublicPath
to
: The recipient addressamount
: The amount of token to transfervaultPath
: The Vault Capability's path of the tokenreceiverPath
: The Receiver Capability's path of the token
flow transactions send './cadence/transactions/tokens/3. Transfer Token.cdc' \
--signer testnet-account \
--network testnet \
--args-json '[
{ "type": "Address", "value": "0xd84327a2b08fd2b1" },
{ "type": "UFix64", "value": "0.1" },
{
"type": "Path",
"value": { "domain": "storage", "identifier": "usdcVault" }
},
{
"type": "Path",
"value": { "domain": "public", "identifier": "usdcReceiver" }
}
]'
publicKey: String
signatureAlgorithm: UInt8
hashAlgorithm: UInt8
publicKey
: Public key of the account as a hexadecimal stringsignatureAlgorithm
: Signature algorithm forPublicKey
as raw data
Algorithm | Raw data |
---|---|
ECDSA_P256 | 1 |
ECDSA_secp256k1 | 2 |
BLS_BLS12_381 | 3 |
Note: New Cadence
enum
type has raw data starting from0
instead of1
.
Thus, it would be increased/decreased by 1 in the code logic to avoid mismatching forFactory.PubKey
.
hashAlgorithm
: Hash algorithm forAccountKey
as raw data
Algorithm | Raw data |
---|---|
SHA2_256 | 1 |
SHA2_384 | 2 |
SHA3_256 | 3 |
SHA3_384 | 4 |
KMAC128_BLS_BLS12_381 | 5 |
KECCAK_256 | 6 |
Note: New Cadence
enum
type has raw data starting from0
instead of1
.
Thus, it would be increased/decreased by 1 in the code logic to avoid mismatching forFactory.Key
.
flow scripts execute './scripts/1. Get Accounts.cdc' \
--network testnet \
--args-json '[
{
"type": "String",
"value": "2ca8f4e4d35917a25f909f738b114201468b2ea0b60ebe2cdd9b6ed3eb25717340e12ac97fbf4efa66f3f45f4673127c9d9f717e40ee4c0aac1dea42ae9db3e4"
},
{ "type": "UInt8", "value": "1" },
{ "type": "UInt8", "value": "1" }
]'
address: Address
balancePaths: [PublicPath]
address
: The account address we want to inspectbalancePaths
: AnPublicPath
array of token's balance paths we want to get balances. If the array size is0
, all token balances available in the account is returned.
flow scripts execute './scripts/2. Get Balances.cdc' \
--network testnet \
--args-json '[
{ "type": "Address", "value": "0xd84327a2b08fd2b1" },
{
"type": "Array",
"value": [
{
"type": "Path",
"value": { "domain": "public", "identifier": "flowTokenBalance" }
},
{
"type": "Path",
"value": { "domain": "public", "identifier": "aspBalance" }
}
]
}
]'
address: Address
receiverPath: [PublicPath]
address
: The account address we want to inspectreceiverPath
: AnPublicPath
array of token's receiver paths we want to check.
flow scripts execute './scripts/3. Check Setup.cdc' \
--network testnet \
--args-json '[
{ "type": "Address", "value": "0xd84327a2b08fd2b1" },
{
"type": "Array",
"value": [
{
"type": "Path",
"value": { "domain": "public", "identifier": "flowTokenReceiver" }
},
{
"type": "Path",
"value": { "domain": "public", "identifier": "fusdReceiver" }
}
]
}
]'