Skip to content

Aurora Eth Connector contract implementation based on NEP-141 for Aurora Engine contract

License

Notifications You must be signed in to change notification settings

Near-One/aurora-eth-connector

Repository files navigation

Aurora Eth Connector

Project license Lints Tests

Aurora Eth Connector - Fungible Token implementation is a smart contract on the NEAR Protocol for the Aurora Engine. It is an implementation for NEP-141.

It is based on AIP: Split NEP-141 logic outside of Engine.

Development

Prerequisites

  • Rust nightly (2022-08-08) with the WebAssembly toolchain
  • cargo-make
rustup target add wasm32-unknown-unknown
cargo install --force cargo-make

Running unit & integration tests

cago make test: tests the whole cargo workspace and the ETH contracts. This requires a --profile argument.

For example, the following will test the whole workspace and the ETH contracts:

cargo make --profile mainnet test 

Building & Make Commands

Every task with cargo make must have a --profile argument.

The currently available profiles are:

  • mainnet, suitable for mainnet.
  • testnet, suitable for testnet.
  • local, suitable for local development.
  • custom, suitable for custom environments, see the note below.

A custom environment may be required depending on the circumstances. This can be created in the .env folder as custom.env following the structure of the other .env files. See bin/local-custom.env for more details.

Every make must follow the following pattern, though --profile is not required for all such as cleanup:

cargo make [--profile <profile>] <task>

Building the aurora-eth-connector contract

There are a few different commands available to build binaries.

The currently available build tasks are:

  • default: does not need to be specified, runs build. Requires a --profile argument.
  • build: builds smart contract and produces aurora-<profile>.wasm in the bin folder. Requires a --profile argument.
  • build-test: builds all tasks using the test features. Requires a --profile argument.
  • build-migration, builds smart contract with the migration functionality and produces aurora-<profile>.wasm in the bin folder.

For example, the following will build the mainnet debug binary:

cargo make --profile mainnet build

Running checks & lints

To run lints and checks, the following tasks are available:

  • check, checks the format, clippy, and ETH contracts.
  • check-fmt, checks the workspace Rust format only.
  • check-clippy, checks the Rust workspace with clippy only.

For example the following command will run the checks. profile is not required here:

cargo make check

License

aurora-eth-connector has CCO-1.0 license