saturn-protocol-ethers
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

saturn-protocol-ethers

Learn more:

Installation:

  • yarn add saturn-protocol-ethers or npm 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.

Contact Team Saturn

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:

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);
}

Package Sidebar

Install

npm i saturn-protocol-ethers

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

121 kB

Total Files

27

Last publish

Collaborators

  • saturn-dao