Răsfoiți Sursa

contract/money: Add some TODOs to Money::Stake.

parazyd 3 ani în urmă
părinte
comite
00b2331b41
1 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 9 0
      src/contract/money/src/entrypoint/stake_v1.rs

+ 9 - 0
src/contract/money/src/entrypoint/stake_v1.rs

@@ -125,6 +125,12 @@ pub(crate) fn money_stake_process_instruction_v1(
         return Err(MoneyError::DuplicateNullifier.into())
     }
 
+    // TODO: (See Money::Transfer) Enforce spend hook for the input in case it's set.
+    // We can allow protocols to execute a staking operation as well.
+
+    // TODO: Check that the value commitment of the input == value commitment in
+    // the Consensus stake mint call.
+
     // Check next call is consensus contract
     let next_call_idx = call_idx + 1;
     if next_call_idx >= calls.len() as u32 {
@@ -138,6 +144,9 @@ pub(crate) fn money_stake_process_instruction_v1(
         return Err(MoneyError::StakeNextCallNotConsensusContract.into())
     }
 
+    // TODO: Also check that the function in Consensus contract being called is the
+    // correct one.
+
     // At this point the state transition has passed, so we create a state update
     let update = MoneyStakeUpdateV1 { nullifier: input.nullifier };
     let mut update_data = vec![];