Skip to content

Commit

Permalink
Fix: check origin domain
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 18, 2023
1 parent 0750988 commit 34a067a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/contracts-core/contracts/manager/BondingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
CallerNotDestination,
CallerNotSummit,
IncorrectAgentDomain,
IncorrectOriginDomain,
IndexOutOfRange,
MerkleTreeFull,
MustBeSynapseDomain,
Expand Down Expand Up @@ -171,8 +172,9 @@ contract BondingManager is AgentManager, InterfaceBondingManager {
// Check that merkle proof is mature enough
// TODO: separate constant for slashing optimistic period
if (proofMaturity < BONDING_OPTIMISTIC_PERIOD) revert SlashAgentOptimisticPeriod();
// TODO: do we need to save this?
msgOrigin;
// TODO: do we need to save domain where the agent was slashed?
// Message needs to be sent from the remote chain
if (msgOrigin == localDomain) revert IncorrectOriginDomain();
// Slash agent and notify local AgentSecured contracts
_slashAgent(domain, agent, prover);
// Magic value to return is selector of the called function
Expand Down

0 comments on commit 34a067a

Please sign in to comment.