This is the community repository for the Spartan Protocol AMM
There are three main branches for this repo:
development
ongoing development branches are merged into thistestnet
this represents the state of current contracts on testnetmainnet
this represents the state of current contracts on mainnet
Click here to jump to the development
branch.
Contributors should work off a fork/duplicate of the development
branch and make a merge request from their forked branch to development
when suitable
Click here to jump to the testnet
branch.
Contributors deploying to testnet and performing testing in that environment should only request a merge request to testnet
once consensus is that their testnet deploy is the most current one in use by the community.
Take note in advance of the latest commit hash of the branch you deployed to testnet (or ideally just make a fork/branch clearly named something like testnet-deploy-004
or something and/or a GitHub issue with suitable identifiers)
Click here to jump to the mainnet
branch.
Contributors deploying to mainnet and performing live testing should only request a merge request to mainnet
once consensus is that their mainnet deploy is the most current one in use by the community.
Take note in advance of the latest commit hash of the branch you deployed to mainnet (or ideally just make a fork/branch clearly named something like mainnet-deploy-004
or something and/or a GitHub issue with suitable identifiers)
Get deps: yarn
Run tests: yarn test
(Script which compiles and calls npx hardhat test
)
Only compile: yarn compile
(Script which calls npx hardhat compile
)
Only run a mock RPC node: yarn node
(Script which calls npx hardhat node
)
Filenames:
- Folders: lower-case-with-dash-separators
- Primary solidity files: PascalCase (camelCase with leading capital letter) like
PoolFactory.sol
- Secondary solidity files (interfaces): camelCase with leading
i
likeiPoolFactory.sol
- All other files: standard camelCase like
poolFactoryTests.js
Inside solidity files:
- Solidity contract names: PascalCase
ie:
contract PoolFactory { }
- Private global vars: with leading
_
ie:uint128 private _asset1Depth;
- Global vars of type
address
: camelCase with tailingAddr
ie:poolFactoryAddr
- Address-type args handed into 'address changing or setting' functions like constructors etc: camelCase with leading
new
and tailingAddr
ie:newPoolFactoryAddr