anoma / ethereum-bridge Goto Github PK
View Code? Open in Web Editor NEWA generalized fully trustless Ethereum bridge for sovereign chains.
Home Page: https://namada.net
License: GNU General Public License v3.0
A generalized fully trustless Ethereum bridge for sovereign chains.
Home Page: https://namada.net
License: GNU General Public License v3.0
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
}
A Vault contract should:
ethereum
to namada
The vault should be independent from the bridge. This way, upgrading the bridge contract doesn't impact transferring tokens.
Tasks:
Vault
contractVault
contract address to proxytransferToERC
functiontransferToNamada
We should emit events if something goes bad i.e bad signatures, bad validators set hash
validatorSetNonce
shouldn't be hardcoded to 0. instead, it should be a Bridge
constructor argument
Token whitelist should be checked before transfering the tokens
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.
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
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:
anvil-deploy
failed on line 33 with exit code 1Namada 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.
Add number of confirmations with a minimum default.
Implement emergency withdrawals in the governance contract
Please share the steps(documentation) for setting the bridge locally between a locally running namada chain and ethereum testnet.
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.
During the same epoch/validator set, multiple call can be made with the same message.
The Proxy
contract should revert upgradeContract
transactions until completeContractInit()
is called
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.
We MUST upgrade the contract after we withdraw the funds!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.