Skip to content

LinkableAnchor2.sol

Implementation

Description

An abstract contract that implements the linking functionality for bridging anchors across chains. This contract inherits all the methods of the base AnchorBase2.sol contract.

Constructor

Details

Signature

constructor( IVerifier _verifier, IHasher _hasher, uint256 _denomination, uint32 _merkleTreeHeight, uint256 _chainID, address _bridge, address _admin, address _handler ) AnchorBase2(_verifier, _hasher, _denomination, _merkleTreeHeight, _chainID)

External Functions

Calls to deposits require a commitment, which is a hash of some secret values.

setHandler

Details

Signature

setHandler(address _handler)

Requires

  • require(..., "sender is not the bridge")

setBridge

Details

Signature

setBridge(address _bridge)

Requires

  • require(..., "sender is not the admin")

addEdge

Details

Signature

addEdge( uint256 sourceChainID, bytes32 root, uint256 height )

Requires

  • require(..., "sender is not the handler")
  • require(..., "This Anchor is at capacity")

Emits

EdgeAddition, RootHistoryUpdate

updateEdge

Details

Signature

updateEdge( uint256 sourceChainID, bytes32 root, uint256 height )

Requires

  • require(..., "sender is not the handler")
  • require(..., "Chain must be integrated from the bridge before updates")
  • require(..., "New height must be greater")

Emits

EdgeUpdate, RootHistoryUpdate