The contracts can be divided into three layers:
src/core
contains the core logic of bridge, which supports arbitrary message passing between blockchains.src/lock_proxy
is layered on top ofsrc/core
to implement asset bridging protocol.src/wrapper
is layered on top ofsrc/lock_proxy
to deduct fees from users using the bridge.
- The initiating tx(ethereum -> aleo) will call
WrapperV1.lock
, which after deducting fees callsLockProxyV1.lock
, which after locking the asset callsBridgeLogic.send
. - The withdrawing tx(aleo -> ethereum) will call
BridgeLogic.receivePayload
, which after verifying signatures of keepers callsBridgeProxy.receivePayloadFromLogic
, which then callsLockProxyV1.onReceive
to finally withdraw the locked asset.