This guide demonstrates how to establish secure communication between Pact contracts. We will use the staking and aggregator contracts from the eckoDEX stack as an example. The respective contract addresses are kaddex.aggregator and kaddex.staking, and both contracts are deployed on chain 2.
For reference, view the contracts here:
In this setup, the aggregator contract handles functionalities such as tracking voting power, while the staking contract manages user staking positions. Users accrue voting power by staking their KDX tokens. Consequently, the staking contract’s stake and unstake entrypoints must update a table in the aggregator contract. Furthermore, the staking contract should be the only entity capable of updating this t