Skip to content

Commit

Permalink
transfer-contract: blocking transfer data calls
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszm committed Feb 1, 2024
1 parent 2902193 commit 575ec69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/transfer/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ impl TransferOps {
&mut self,
tx: Transaction,
) -> Result<Vec<u8>, ContractError> {
if let Some((contract_id, _, _)) = tx.call {
if contract_id == TRANSFER_DATA_CONTRACT.to_bytes() {
panic!("Transfer data contract can only be called from the transfer contract");
}
}

// 1. α ∈ R
if !self.root_exists(&tx.anchor) {
panic!("Anchor not found in the state!");
Expand Down

0 comments on commit 575ec69

Please sign in to comment.