The Cadence contracts defined in this repository are for use on the FrontRow platform at frontrow.kr
The contracts and tests have been extracted from an Nx monorepo.
See the Readme in apps/flow-test
The Flow CLI must be installed and available globally:
# Mac
brew install flow-cli
# Linux
sh -ci "$(curl -fsSL https://storage.googleapis.com/flow-cli/install.sh)"
Install packages
npm install
npm run flow-test
When running transactions via the emulator, you can print logs using the log()
function and prefixing the output with LOG:
, e.g.
transaction() {
execute {
log("LOG: HELLO!!!")
}
}
Local (emulator)
npm run flow-dev
Docker (emulator)
docker build --progress=plain --no-cache -t flow-dev -f apps/flow-test/Dockerfile --target=dev .
Testnet
- Requires
flow-testnet.json
withaccounts/testnet-account
- Import aliases must be set up correctly
Create FrontRow
flow accounts add-contract FrontRow ./libs/shared/data-access-flow/src/lib/frontrow/contracts/FrontRow.cdc --signer testnet-account -n testnet -f flow.json -f flow-testnet.json
Create FrontRowStorefront
flow accounts add-contract FrontRowStorefront ./libs/shared/data-access-flow/src/lib/frontrow/contracts/FrontRowStorefront.cdc --signer testnet-account -n testnet -f flow.json -f flow-testnet.json
Update
Use the above commands, but replace add-contract
with update-contract
- apps/flow-test
- An Nx app containing all the unit tests for the FrontRow contracts
npm run flow-test
runs the testsnpm run flow-dev
starts the emulator with a basic dev environment- FrontRow and FrontrowStorefront contracts deployed, with some Flow and FUSD minted to the
emulator-account
- FrontRow and FrontrowStorefront contracts deployed, with some Flow and FUSD minted to the
- libs/shared/data-access-flow
- Contains the FrontRow contracts and some utilities for interacting with them
- libs/shared/util-flow
- Flow related utility library with no local sub-dependencies
- libs/shared/util-flow-crypto
- Library for signing Flow transactions with a private key
- Only used in development and testing
- libs/shared/util-core
- Low level utilities shared between Flow/frontend/backend