Giter VIP home page Giter VIP logo

chaindata's Introduction

Cross-chain EVM-based Tokens

Live data source available on chainid.json

Deploy your own token and create a PR by following the guide

Example

"yfi": {
  "srcChainID": "1",
  "destChainID": "56",
  "PairID": "YFI",
  "SrcToken": {
    "ID": "YFI",
    "Name": "yearn.finance",
    "Symbol": "YFI",
    "Decimals": 18,
    "Description": "yearn.finance",
    "DepositAddress": "0x13B432914A996b0A48695dF9B2d701edA45FF264",
    "mpcAddress": "0x13B432914A996b0A48695dF9B2d701edA45FF264",
    "ContractAddress": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",
    "MaximumSwap": 20,
    "MinimumSwap": 0.0005,
    "BigValueThreshold": 5,
    "SwapFeeRate": 0,
    "MaximumSwapFee": 0,
    "MinimumSwapFee": 0,
    "PlusGasPricePercentage": 10,
    "DisableSwap": false,
    "IsDelegateContract": false
  },
  "DestToken": {
    "ID": "anyYFI",
    "Name": "YFI-ERC20",
    "Symbol": "anyYFI",
    "Decimals": 18,
    "Description": "cross chain bridge YFI with anyYFI",
    "mpcAddress": "0x13B432914A996b0A48695dF9B2d701edA45FF264",
    "ContractAddress": "0x9883ae441105f815b472517389b979f031b5c87e",
    "MaximumSwap": 20,
    "MinimumSwap": 0.002,
    "BigValueThreshold": 2,
    "SwapFeeRate": 0.001,
    "MaximumSwapFee": 0.01,
    "MinimumSwapFee": 0.001,
    "PlusGasPricePercentage": 1,
    "DisableSwap": false,
    "IsDelegateContract": false
  }
}

EVM-based Chains

Listed by chainId according to EIP-155

Data source available on ~/ethereum-lists/chains/_data/chains.json

Example

{
  "name": "Ethereum Mainnet",
  "chain": "ETH",
  "network": "mainnet",
  "rpc": [
    "https://mainnet.infura.io/v3/${INFURA_API_KEY}",
    "https://api.mycryptoapi.com/eth"
  ],
  "faucets": [],
  "nativeCurrency": {
    "name": "Ether",
    "symbol": "ETH",
    "decimals": 18
  },
  "infoURL": "https://ethereum.org",
  "shortName": "eth",
  "chainId": 1,
  "networkId": 1
}

chaindata's People

Contributors

0xdcota avatar 0xruhum avatar arjunbhuptani avatar auroxdefi avatar carlomazzaferro avatar connextworkshop avatar dutchybeatz avatar excaliborr avatar hesnicewithit avatar jakekidd avatar jchung00 avatar johannbarbie avatar just-a-node avatar kesar avatar laynehaber avatar liu-zhipeng avatar ltyu avatar mandalorian-101 avatar mantasfam avatar mellaught avatar multiart avatar prathmeshkhandelwal1 avatar preethamr avatar rhlsthrm avatar romang11 avatar sanchaymittal avatar sonmezturk avatar spontaneousoverthrow avatar vladpanov avatar wanglonghong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chaindata's Issues

Unable to deploy - TypeError: Cannot read property 'fromRed' of null

Hi,

After entering all of the information for Binance deployment, I am getting the following error when running node deploy.js:
TypeError: Cannot read property 'fromRed' of null

/Users/vlad/Documents/_DEV/chaindata/node_modules/elliptic/lib/elliptic/curve/short.js:415
  return this.x.fromRed();
                ^

TypeError: Cannot read property 'fromRed' of null
    at Point.getX (/Users/vlad/Documents/_DEV/chaindata/node_modules/elliptic/lib/elliptic/curve/short.js:415:17)
    at Point._encode (/Users/vlad/Documents/_DEV/chaindata/node_modules/elliptic/lib/elliptic/curve/base.js:300:16)
    at Point.encode (/Users/vlad/Documents/_DEV/chaindata/node_modules/elliptic/lib/elliptic/curve/base.js:309:28)
    at KeyPair.getPublic (/Users/vlad/Documents/_DEV/chaindata/node_modules/elliptic/lib/elliptic/ec/key.js:66:19)
    at new SigningKey (/Users/vlad/Documents/_DEV/chaindata/node_modules/@ethersproject/signing-key/lib/index.js:22:71)
    at new Wallet (/Users/vlad/Documents/_DEV/chaindata/node_modules/@ethersproject/wallet/lib/index.js:123:36)
    at Object.<anonymous> (/Users/vlad/Documents/_DEV/chaindata/deploy.js:59:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)

In terms of changes, I've only updated the required 39 - 55:

const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed1.binance.org/');
const verifyURL = 'https://api.bscscan.com/api';
const privateKey = Buffer.from('0x1e...', 'hex');
const apikey = 'VKVS...';

const mpcAddress = '0x533e3c0e6b48010873B947bddC4721b1bDFF9648';
const signer = new ethers.Wallet(privateKey, provider);
const constructorArgs = ['<name>', '<symbol>', '18', '', signer.address];

Any guidance would be super appreciated. Thank you!

Are there any bugs in the AnyswapV4ERC20.sol?

Description

When we recently used the fuzz testing tool, we scanned the contract AnyswapV4ERC20.sol. We found some issues and wanted to confirm with you.

    function depositWithPermit(address target, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s, address to) external returns (uint) {
        IERC20(underlying).permit(target, address(this), value, deadline, v, r, s);
        IERC20(underlying).safeTransferFrom(target, address(this), value);
        return _deposit(value, to);
    }

WETH does not implement the permit function specified by ERC20 and implements the fallback function. At the same time, the permit function has no return value, so no error will be reported when calling WETH's permit function. If the underlying address is the address of the WETH contract, will there be such a problem?

Logical error in transferWithPermit

Hi,

There is a logical error in one of the require in transferWithPermit:

require(to != address(0) || to != address(this));

it should be

require(to != address(0) && to != address(this));

otherwise it has no sens as to=address(this) will pass.

Guide for "creating a wrapper for a token"

From this markdown main/deploy.md i found out if i already have a token deployed i would need to:

Deploy a wrapper for your token that supports mint, burn, Swapin, and Swapout, add this wrapper as a minter role in the ACL. In the wrapper add the MPC address (found below) as a minter

Could you by any chance consider writing or pointing me to a more detailed guide on this topic?


Just to add some context here, i'm trying to deploy The Aluna Token to multiple chains, currently it's only available on Ethereum main net.

Our token was deployed using the Proxy Patter ( standard OpenZeppelin ) so we could update it with the necessary functions to a new implementation, but after having a look at AnyswapV5ERC20.sol it's not very clear what the best approach would be.

There are a few key questions here:

  • Our token isn't ERC20Mintable, but we need to implement it in order to be able to have MPC address as a minter, correct?
  • Our token is already an ERC20Burnable.sol but from reading AnyswapV5ERC20.sol i can tell the burn function works slightly different on AnyswapV5ERC20.sol than on ERC20Burnable.sol, that's the reason why we need a Wrapper for our ERC-20? Is there a Wrapper Example for ERC-20 anywhere?

Thank You

Use Local Memory Type Variable Instead of Global Storage Type Variable in Event to Save Gas

Hi, we recently have conducted a systematic study about Solidity event usage, evolution, and impact, and we are attempting to build a tool to improve the practice of Solidity event use based on our findings. We have tried our prototype tool on some of the most popular GitHub Solidity repositories, and for your repository, we find a potential optimization of gas consumption arisen from event use.

The point is that when we use emit operation to store the value of a certain variable, local memory type variable would be preferable to global storage type (state) variable if they hold the same value. The reason is that an extra SLOAD operation would be needed to access the variable if it is storage type, and the SLOAD operation costs 800 gas.

For your repository, we find that the following event use can be improved:

  • AnyswapV5ERC20.sol
    function name:changeVault
    event name:  LogChangeVault
    variable:    pendingVault->newVault
    function changeVault(address newVault) external onlyVault returns (bool) {
        require(newVault != address(0), "AnyswapV3ERC20: address(0x0)");
        pendingVault = newVault;
        delayVault = block.timestamp + delay;
        emit LogChangeVault(vault, pendingVault, delayVault);
        return true;
    }

  function name:changeMPCOwner
  event name:  LogChangeMPCOwner
  variable:    pendingVault->newVault

    function changeMPCOwner(address newVault) public onlyVault returns (bool) {
        require(newVault != address(0), "AnyswapV3ERC20: address(0x0)");
        pendingVault = newVault;
        delayVault = block.timestamp + delay;
        emit LogChangeMPCOwner(vault, pendingVault, delayVault);
        return true;
    }
  • AnyswapV4ERC20.sol
    function name:changeVault
    event name:  LogChangeVault
    variable:    pendingVault->newVault
    function changeVault(address newVault) external onlyVault returns (bool) {
        require(newVault != address(0), "AnyswapV3ERC20: address(0x0)");
        pendingVault = newVault;
        delayVault = block.timestamp + delay;
        emit LogChangeVault(vault, pendingVault, delayVault);
        return true;
    }

  function name:changeMPCOwner
  event name:  LogChangeMPCOwner
  variable:    pendingVault->newVault

    function changeMPCOwner(address newVault) public onlyVault returns (bool) {
        require(newVault != address(0), "AnyswapV3ERC20: address(0x0)");
        pendingVault = newVault;
        delayVault = block.timestamp + delay;
        emit LogChangeMPCOwner(vault, pendingVault, delayVault);
        return true;
    }

Do you find our results useful? Your reply and invaluable suggestions would be greatly appreciated, and are vital for improving our tool. Thanks a lot for your time!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.