saturn-protocol-ethers
v0.0.1
Published
Saturn Protocol - Hardhat Typechain Ethers
Downloads
3
Maintainers
Readme
saturn-protocol-ethers
Learn more:
- Website -> https://saturn.network
- Deployed on ETH -> https://etherscan.io/address/0xaA5bBD5A177A588b9F213505cA3740b444Dbd586#code
Installation:
yarn add saturn-protocol-ethers
ornpm install saturn-protocol-ethers
Disclaimer
Team Saturn accepts no responsibility for any lost funds due to tokens not being compatible with Saturn Protocol's order book contracts. If any of the trading tests outlined in our self listing guide fail for your token, then do not announce your listing as your token's smart contract is not compatible with our exchange protocol. Reach out via the form below and we will investigate together.
Upgrades
- ethers v5
- hardhat
- typechain
Example
import { providers } from 'ethers'
import { Exchange__factory, exchanges } from 'saturn-protocol-dione'
const provider = new providers.JsonRpcProvider(
'https://ethercluster.com/etc',
{ name: 'etc', chainId: 61 }
)
const { contractAddress } = exchanges.latest('ETC')
const exchange = Atlas__factory.connect(contractAddress, provider)
exchange.treasury().then(console.log)
Supported tokens
The protocol supports self-listing of properly developed ERC20 and ERC223 standard tokens. Most tokens, such as SATURN, DAI, LINK are tradable out of the box.
If you or your developers have made any modifications to the source code of ERC20 or ERC223 standards, your token might not be able to work with Saturn Protocol. Furthermore, due to a vulnerability in ERC20 design your ERC20 tokens may get permanently lost if mishandled!
While 99% of all existing tokens are supported out of the box, you should go through the full self listing guide to ensure your community will have a smooth and secure trading experience.
Reference implementations that are guaranteed to work:
- https://github.com/saturn-network/wetc223
- https://github.com/smartcontractkit/LinkToken
Reference ABIs
ERC223
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) constant public returns (uint);
function name() constant public returns (string _name);
function symbol() constant public returns (string _symbol);
function decimals() constant public returns (uint8 _decimals);
function totalSupply() constant public returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
}
ERC20
contract ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address holder) public view returns (uint);
function allowance(address holder, address other) public view returns (uint);
function approve(address other, uint amount) public returns (bool);
function transfer(address to, uint amount) public returns (bool);
function transferFrom(address from, address to, uint amount) public returns (bool);
}