Core smart contracts of ETH AF
npm install @ethaf/ethaf-coreCore smart contracts of ETH AF
This repository contains the core smart contracts for the ETH AF Protocol.
For higher level contracts, see the ethaf-periphery
repository.
In order to deploy this code to a local testnet, you should install the npm package@ethaf/ethaf-core
and import the factory bytecode located at@ethaf/ethaf-core/artifacts/contracts/EthAfFactory.sol/EthAfFactory.json.
For example:
``typescript
import {
abi as FACTORY_ABI,
bytecode as FACTORY_BYTECODE,
} from '@ethaf/ethaf-core/artifacts/contracts/EthAfFactory.sol/EthAfFactory.json'
// deploy the bytecode
`
This will ensure that you are testing against the same bytecode that is deployed to
mainnet and public testnets, and all ETH AF code will correctly interoperate with
your local deployment.
The ETH AF interfaces are available for import into solidity smart contracts
via the npm artifact @ethaf/ethaf-core, e.g.:
`solidity
import '@ethaf/ethaf-core/contracts/interfaces/IEthAfPool.sol';
contract MyContract {
IEthAfPool pool;
function doSomethingWithPool() {
// pool.swap(...);
}
}
`
The primary license for ETH AF Core is GPL-2.0-or-later
- contracts/libraries/FullMath.sol is licensed under MIT (as indicated in its SPDX header), see contracts/libraries/LICENSE_MITcontracts/test` remain unlicensed (as indicated in their SPDX headers).
- All files in