Giter VIP home page Giter VIP logo

ethereum-bridge's People

Contributors

fraccaman avatar sug0 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

ethereum-bridge's Issues

Be able to deploy the smart contracts non-interactively

It would be useful to be able to specify deployment configuration up front in a JSON5 file and then have the deploy script use it where possible rather than prompting for values, e.g. something like

npx hardhat run scripts/deploy.js --config config.json

where config.json might look something roughly like

{
    "bridge_validator_set": "/tmp/dev-validator-set.json",  // path to a file, or the validator set could even be inline?
    "wnam_total_supply": 10000,
    "token_whitelist": [
        {
            "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
            "total_supply_cap": 10000
        }
        // ...
    ]
    // ... any other config options appropriate for deployment
}

Vault contract

A Vault contract should:

  • hold escrow of the tokens when trasfering from ethereum to namada
  • allow transferring of tokens from escrow if authorized by the bridge

The vault should be independent from the bridge. This way, upgrading the bridge contract doesn't impact transferring tokens.

Tasks:

  • Create Vault contract
  • Add Vault contract address to proxy
  • Update transferToERC function
  • Update transferToNamada
  • Update the bridge upgrade mechanism
  • Update tests
  • Update deploy script
  • Update benchmarks

Token whitelist

Token whitelist should be checked before transfering the tokens

Remove `upgradeBridgeContract`

upgradeContract in Governance.sol currently has the following requirement:

require(keccak256(abi.encode(_name)) != keccak256(abi.encode("bridge")), "Invalid contract name.");

It may be better to merge upgradeBridgeContract and upgradeContract into a single call. Ideally, these administration operations only require a cold key.

trying to deploy. pleasyou can guys help me debug?

root@vmi1614179:~/ethereum-bridge/script# just anvil-deploy script/bridge_validator_set.json script/governance_validator_set.json
[⠒] Compiling...
[⠃] Compiling 1 files with 0.8.21
[⠊] Solc 0.8.21 finished in 17.73s
Compiler run successful!
EIP-3855 is not supported in one or more of the RPCs used.
Unsupported Chain IDs: 31337.
Contracts deployed with a Solidity version equal or higher than 0.8.20 might not work properly.
For more information, please see https://eips.ethereum.org/EIPS/eip-3855
Script ran successfully.

== Logs ==
Proxy | 0x5FbDB2315678afecb367f032d93F642f64180aa3
Vault | 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
Token | 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
Bridge | 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
TestERC20 | 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9

Setting up 1 EVM.

2024-03-14T19:46:19.301410Z ERROR forge_script::transaction: Failed to decode constructor arguments contract=Some("ERC20") signature=constructor(string,string) is_create2=false constructor_args=0000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608490fd5b15610a9a57565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608490fd5b610a036109f96109f37f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92593610b99610b596101895f610757565b610b7b8173ffffffffffffffffffffffffffffffffffffffff85161415610a08565b73ffffffffffffffffffffffffffffffffffffffff88161415610a93565b6109ee876109c98861061b8560016105cc565b15610bb357565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b90610c1d8183610609565b92839060018201610c30575b5050505050565b610c499461074661069493610c428490565b1115610bac565b5f80808080610c2956000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f0512000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000b57726170706564204e414d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004774e414d00000000000000000000000000000000000000000000000000000000
Error:
buffer overrun while deserializing

Context:

  • buffer overrun while deserializing
    error: Recipe anvil-deploy failed on line 33 with exit code 1

Add hashes of transfers to the TransferToEthereum event

Namada monitors events from Ethereum to know which transfers in the bridge pool have been relayed. This is done via the TransferToEthereum event. However, this event does not currently give enough information to uniquely determine the transfer in the pool to which it refers. Thus the event should include the hash of the transfer.

Ethereum bridge local setup

Please share the steps(documentation) for setting the bridge locally between a locally running namada chain and ethereum testnet.

Add confirmations to events.

Users are supposed to be able to specify the min number of confirmations for their ethereum txs. We need to know this number, so it should be passed out via events.

@Fraccaman

TransferToErc and TransferToNamad interfaces inconsistent.

First of all, there is a type: TrasferToErc should be TransferToErc.

Secondly, the signatures should be almost identical except for the tos addresses. However, currently these signatures have their arguments in a different order. I would like to propose the following signatures:

    event TransferToNamada(uint256 indexed nonce, address[] froms, string[] tos, uint256[] amounts);
    event TransferToERC(uint256 indexed nonce, address[] froms, address[] tos, uint256[] amounts);

This allows me to write some generic code for parsing these events instead of heaving to write to separate parsers.

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.