Skip to content

Expand Sui M1 Package Docs and Create Walkthrough #133

Draft
stevep0z wants to merge 1 commit intomainfrom
feat/sui-v1-updates
Draft

Expand Sui M1 Package Docs and Create Walkthrough #133
stevep0z wants to merge 1 commit intomainfrom
feat/sui-v1-updates

Conversation

@stevep0z
Copy link
Copy Markdown
Collaborator

@stevep0z stevep0z commented Mar 9, 2026

Documentation Pull Request

Summary

Type of Change

  • New documentation
  • Documentation update/revision
  • Fix typos or grammar
  • Restructure/reorganize content
  • Add examples or tutorials
  • Update API documentation
  • Other: ___________

Related Issues

Fixes #
Relates to #

Checklist

Additional Notes

@stevep0z stevep0z self-assigned this Mar 9, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 9, 2026

Deploy Preview for openzeppelin-docs-v2 ready!

Name Link
🔨 Latest commit 02b99c8
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/69af14a84e784a0009ef8f18
😎 Deploy Preview https://deploy-preview-133--openzeppelin-docs-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

```move
module my_sui_app::admin;

use openzeppelin_access::two_step_transfer;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this empty lines hurts readability

const MIN_DELAY_MS: u64 = 86_400_000; // 24 hours

public fun wrap_treasury_cap(cap: TreasuryCap, ctx: &mut TxContext): DelayedTransferWrapper<TreasuryCap> {
delayed_transfer::wrap(cap, MIN_DELAY_MS, ctx)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API is now different. It accepts a recipient and doesn't return the DelayedTransferWrapper

<Callout type="warn">
`two_step_transfer` records `ctx.sender()` as the cancel authority (`from`) when `initiate_transfer` is called. In normal single-owner usage, `ctx.sender()` is the wallet that holds the wrapper, the correct principal to hold cancel authority.

However, if `initiate_transfer` is invoked inside a shared-object executor, a module where any user can be the transaction sender, then the cancel authority becomes that arbitrary user's address, not the protocol's. A malicious user could call `initiate_transfer` targeting their own address as the recipient. They would become both the pending recipient and the only party with cancel authority, locking out the legitimate owner: no one but the attacker can cancel the transfer, and the attacker can choose to accept it at any time.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A malicious user could call initiate_transfer targeting their own address as the recipient

They don't even need to target their own address, they can target the right address and still get the inner object by cancelling later, as they are the cancel authority.

Copy link
Copy Markdown
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good in general. Left some comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants