I found my missing icp at this address(https://dashboard.internetcomputer.org/account/a721a85c2ec1f01003022d2d1bba09c70474eb5b07dd4f45012edc21e587371f) , then I called notify_top_up and it shows the following error,
{‘InvalidTransaction’: ‘Intent in the block (0 == unrecognized: Memo(0)) different than in the notification (1347768404 == TopUp)’}}
how should I get back this 30 icp, thanks
@jennifertran can you help me ser?
I use the notify_top_up function of rkp4c-7iaaaa-aaaaa-aaaca-cai for recharging
canister :y6ifo-2qaaa-aaaai-qpgpa-cai
it seems that you did not set the (correct) memo
so the transfer is recognized as a topup.
Error:
};
if to != expected_destination_account {
return Err(NotifyError::InvalidTransaction(format!(
"Destination account in the block ({}) different than in the notification ({})",
to, expected_destination_account
)));
}
let memo = block.transaction().memo;
if memo != expected_memo {
return Err(NotifyError::InvalidTransaction(format!(
"Intent in the block ({} == {}) different than in the notification ({} == {})",
memo.0,
memo_to_intent_str(memo),
expected_memo.0,
memo_to_intent_str(expected_memo),
)));
}
Ok((amount, from))
}
available Memos;
}
/// Result of the cycles ledger's `deposit` endpoint
#[derive(Clone, Eq, PartialEq, Hash, Debug, CandidType, Deserialize, Serialize)]
pub struct CyclesLedgerDepositResult {
pub balance: Nat,
pub block_index: Nat,
}
pub const MEMO_CREATE_CANISTER: Memo = Memo(0x41455243); // == 'CREA'
pub const MEMO_TOP_UP_CANISTER: Memo = Memo(0x50555054); // == 'TPUP'
pub const MEMO_MINT_CYCLES: Memo = Memo(0x544e494d); // == 'MINT'
pub fn create_canister_txn(
amount: Tokens,
from_subaccount: Option<Subaccount>,
cycles_canister_id: &CanisterId,
creator_principal_id: &PrincipalId,
) -> (SendArgs, Subaccount) {
let sub_account = creator_principal_id.into();
let send_args = SendArgs {
There seems to be a refund_icp
method but its not exposed for external use, so i’m afraid your funds are stuck at this moment
let code = code.unwrap_or_default();
print(format!("{} failed with code {}: {:?}", msg, code, err))
}
}
}
/// Send the funds for canister creation or top up back to the sender,
/// minus the transaction fee (which is gone) and the fee for the
/// action (which is burned). Returns the index of the block in which
/// the refund was done.
async fn refund_icp(
from_subaccount: Subaccount,
to: AccountIdentifier,
amount: Tokens,
extra_fee: Tokens,
) -> Result<Option<BlockIndex>, NotifyError> {
let ledger_canister_id = with_state(|state| state.ledger_canister_id);
let mut refund_block_index = None;
let mut burned = amount;
let mut refunded = Tokens::ZERO;
1 Like
rem.codes:
refund_icp
Your analysis is very correct, so is there any way I can get a refund? Thank you for your time.
There is no exposed call on the cycles minting canister to trigger a transfer, but it would make sense to add such a call to the CMC imo. Other question, are you the controller of the canister you wanted to top up?
yes, i am the controller of the canister
Ok, for now there isnt anything that can be done, i requested adding some functionality to the CMC canister Extend cycles minting canister functionality . But for next time I would suggest using something like https://www.icptopup.com/ which makes it a lot easier to top up canisters