Skip to content

noma-protocol/core_contracts

Repository files navigation

Noma Protocol core contracts

This is the Noma protocol core contracts repository. Noma is a next-generation DeFi protocol, read more on our official website.

Built with Foundry ❤️

Building

To install all dependencies and build the contracts run the following commands:

foo@bar:~/core_contracts$ ./install_deps.sh

Testing

  1. Use anvil to fork the Arbitrum mainnet blockchain. Replace the fork-url with your rpc node. Do not forget the mnemonic phrase.
foo@bar:~/core_contracts$ anvil --balance 10000000000 --fork-url https://arb-mainnet.g.alchemy.com/v2/DeadBeefDeadBeefDeadBeef \
--accounts 2 -m "example some mnemonic phrase generated randomly you wish to use  goes here" --chain-id=1337 --port 8545

Example output:

Available Accounts
==================

(0) 0x8Fc4f07BCB9396722404bFfBE1A77cF73Af06E47 (10000000000.000000000000000000 ETH)
(1) 0xEbA88149813BEc1cCcccFDb0daCEFaaa5DE94cB1 (10000000000.000000000000000000 ETH)

Private Keys
==================

(0) 0x9998817771311c1cCdddFDb0daCEFaaa5DE94cB1a4d4141333d36adddd01dfff
(1) 0x9f7365f2EFaaa5DE913070x8Fc4f07BCB9396722404bFfBE1A77cF73Af06E47f

  1. Setup an .env file with DEPLOYER as the first address (0) and the corresponding private key, as well as the local RPC_URL.
 DEPLOYER="0x8Fc4f07BCB9396722404bFfBE1A77cF73Af06E47"
 PRIVATE_KEY="0x9998817771311c1cCdddFDb0daCEFaaa5DE94cB1a4d4141333d36adddd01dfff"
 RPC_URL="http://localhost:8545"
  1. Deploy contracts locally on the forked blockchain with the following command:
foo@bar:~/core_contracts$ ./deploy.sh 
  1. Run tests with the following command:
foo@bar:~/core_contracts$ forge test --rpc-url http://localhost:8545

Static Analysis - Slither

Please go to the link above for detail to install. To run the analysis:

foo@bar:~/core_contracts$ slither src

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages