You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it possible to have a two step process for the ownership transfer. Create specs on how to achieve this variability through the same extension.
Possible Solution (optional)
/// Data used to accept ownership of a contract.////// The payload does not need to specify the new owner, as the signature/// will be verified by the contract that has access to the new owner#[derive(Debug,Clone,Copy,PartialEq,Eq,Archive,Serialize,Deserialize)]#[archive_attr(derive(CheckBytes))]pubstructAcceptOwnership{nonce:u64,signature:Signature,}implAcceptOwnership{constSIGNATURE_MSG_SIZE:usize = 8;/// Create a new `AcceptOwnership` transaction. This transaction is used to/// accept ownership of an account when the ownership is implemented as a/// two-step process.////// # Arguments////// * `new_owner_sk` - The secret key of the new owner./// * `nonce` - The nonce of the account.pubfnnew(new_owner_sk:&SecretKey,nonce:u64) -> Self{letmut accept_ownership = Self{
nonce,signature:Signature::default(),};let sig_msg = accept_ownership.signature_message();let sig = new_owner_sk.sign(&sig_msg);
accept_ownership.signature = sig;
accept_ownership
}/// The message to be signed over.pubfnsignature_message(&self) -> [u8;Self::SIGNATURE_MSG_SIZE]{self.nonce.to_le_bytes()}/// Get the nonce specified for this transaction.pubfnnonce(&self) -> u64{self.nonce}/// Get the signature specified for this transaction.pubfnsignature(&self) -> &Signature{&self.signature}}
The text was updated successfully, but these errors were encountered:
Summary
Make it possible to have a two step process for the ownership transfer. Create specs on how to achieve this variability through the same extension.
Possible Solution (optional)
The text was updated successfully, but these errors were encountered: