Usage for the example project:
- Pull the Solidity source files from git:
npx tsx src/index.ts pull nabla
- Deploy:
npx tsx src/index.ts deploy nabla --network foucoco --deployment mockTestnet
Alternatively you can use the parameter local
instead of foucoco
. This expects that there is a local chain running
on port 9944
– this is particularly useful to run together with
the foucoco-standalone node.
The deploy
command takes two required arguments:
--network
: one of the networks defined in the filenabla/config.json
(pendulum
,foucoco
orlocal
)--deployment
: one of the deployment definitions, seenabla/deployments/selector.ts
:usdtVortexPrototype
: described on NotionusdcAxelarVortexPrototype
: described on NotionproductionPendulum
: described on NotionmockTestnet
: described on NotionslippageTest
: used for validating slippage calulcations, see this page on Notion
brew install binaryen
You can find the installation instructions for solang here.
Create a file localConfig.json
in the root folder of this repository and add the following content:
{
"solangPath": "path/to/your/solang/binary"
}
If you want to test a specific version, you can build solang from source.
Make sure you have at least rust v1.74 or later installed. You can install it with rustup using
rustup install 1.74
rustup default <that_version>
You need to have a custom version of LLVM available. To install it, please follow the steps here.
Clone the solang repository and build it:
mkdir clones
cd clones
git clone https://github.com/hyperledger/solang/
cd solang
cargo build --release
If you encounter issues during the compilation, consider switching to the
latest release version instead of building directly from main
branch.
Before deploying the contracts, you need to make sure that the contracts are available in the target/git
directory.
To do this, run the following command:
npm run pull:nabla
This will clone the contracts from the git repository and place them in the target/git
directory.
Then, you can deploy the contracts using the following command:
# Deploy to Foucoco
npm run deploy:foucoco
# Deploy to local chain
npm run deploy:local
If you encounter the errors about missing contract files, you need to make sure that the Solidity files are present in
the
target/git
directory.
In the nabla/config.json
file, you can find configuration of import paths for additional Solidity files.
In order for this to work, you need to make sure that the node_modules
folder is present in each of the cloned
subdirectories of target/git
.
These are only available if the npm install
or yarn install
command was executed successfully in the respective
directory.
This should automatically be done by the 'deploy' script though, so if you encounter this issue, try debugging
dependency issues in the respective package.json
file.