zeta-chain / protocol-contracts

Protocol contracts implementing the core logic of the protocol, deployed on ZetaChain and on connected chains
MIT License
68 stars 55 forks source link

Setup single chain localnet for V2 contracts #189

Closed lumtis closed 2 months ago

lumtis commented 3 months ago

Implement a command

yarn localnet

That spins up a localnet environment on a single local evm chains. Both ZEVM and EVM contracts are deployed on a single local evm, the developers can interact with ZEVM and EVM gateways.

The cross-chain application can be simulated on a single network.

This would allow:

Solutions to look for to relay the messages:

fadeev commented 3 months ago

I like the worker idea.

lumtis commented 3 months ago

I might think solution 2 could be easier to implement if it works with inheritance, and would be more efficient for fuzz testing.

Now on the practice, I'm not 100% sure it can be implemented. If we need to develop whole other contracts, then workers might be better to simulate environment.

contract GatewayWithForwarding is Gateway

// ...

function call(...) overwrite {
  super.call()

  // call counterparty chain contract here
}