Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create object with permissioned signer #15707

Conversation

runtian-zhou
Copy link
Contributor

@runtian-zhou runtian-zhou commented Jan 10, 2025

Description

Allowed transfer ref to grant permission to the permissioned signer.

How Has This Been Tested?

Test added

Key Areas to Review

Whether the granting logic is safe.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Jan 10, 2025

⏱️ 6h 12m total CI duration on this PR
Job Cumulative Duration Recent Runs
check-dynamic-deps 2h 7m 🟩🟩🟩🟩🟩 (+57 more)
rust-cargo-deny 1h 48m 🟩🟩🟩🟩🟩 (+58 more)
general-lints 29m 🟩🟩🟩🟩🟩 (+58 more)
semgrep/ci 25m 🟩🟩🟩🟩🟩 (+57 more)
rust-targeted-unit-tests 22m 🟥
rust-move-tests 16m 🟥
rust-move-tests 16m 🟥
file_change_determinator 11m 🟩🟩🟩🟩🟩 (+58 more)
rust-move-tests 6m
rust-lints 4m 🟩
rust-move-tests 3m
permission-check 3m 🟩🟩🟩🟩🟩 (+55 more)
permission-check 2m 🟩🟩🟩🟩🟩 (+54 more)
rust-check-merge-base 1m 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

runtian-zhou commented Jan 10, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch 2 times, most recently from 66b0a0a to 5f78ed5 Compare January 10, 2025 18:58
Comment on lines +729 to +737
/// Grant a transfer permission to the permissioned signer using TransferRef.
public fun grant_permission_with_transfer_ref(
permissioned_signer: &signer,
ref: &TransferRef,
) {
permissioned_signer::grant_unlimited_with_permissioned_signer(
permissioned_signer,
TransferPermission { object: ref.self }
)
Copy link

Choose a reason for hiding this comment

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

Add spec block before function to specify abort conditions:
spec grant_permission_with_transfer_ref {
aborts_if !permissioned_signer::is_permissioned_signer(permissioned_signer) with error::permission_denied();
}

Spotted by Graphite Reviewer (based on CI logs)

Is this helpful? React 👍 or 👎 to let us know.

@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from 8148ebc to dfa01cc Compare January 10, 2025 22:51
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 5f78ed5 to a1bc425 Compare January 10, 2025 22:51
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from dfa01cc to dfe7a0b Compare January 10, 2025 22:59
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from a1bc425 to 9baff65 Compare January 10, 2025 23:00
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from dfe7a0b to 1f5be33 Compare January 10, 2025 23:34
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 9baff65 to 41af726 Compare January 10, 2025 23:34
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from 1f5be33 to dbdce9e Compare January 10, 2025 23:53
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 41af726 to a8d8e8e Compare January 10, 2025 23:53
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from dbdce9e to cf19520 Compare January 11, 2025 00:23
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from a8d8e8e to 5d0736d Compare January 11, 2025 00:23
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from cf19520 to d4bcfe0 Compare January 11, 2025 01:24
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 5d0736d to 164a5ac Compare January 11, 2025 01:24
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from d4bcfe0 to d88840b Compare January 11, 2025 01:58
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 164a5ac to edda220 Compare January 11, 2025 01:58
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from d88840b to 2f50393 Compare January 11, 2025 03:43
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from 63aa26f to 8e5e1bd Compare January 15, 2025 07:35
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 217346d to 45c2794 Compare January 15, 2025 07:36
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from 8e5e1bd to f87b058 Compare January 15, 2025 15:22
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 45c2794 to a368fd6 Compare January 15, 2025 15:22
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from f87b058 to fb11eef Compare January 15, 2025 15:25
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from a368fd6 to f2d1cc7 Compare January 15, 2025 15:26
@runtian-zhou runtian-zhou changed the base branch from 12-17-feature_gate_permissioned_signer to 09-11-permission_for_framework January 15, 2025 15:26
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 475d6ba to 29845a2 Compare January 15, 2025 15:35
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from f2d1cc7 to 154c5d2 Compare January 15, 2025 15:36
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 29845a2 to fc71bc4 Compare January 15, 2025 17:58
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 154c5d2 to 7fce8b6 Compare January 15, 2025 17:59
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from fc71bc4 to ab3a6dc Compare January 15, 2025 18:27
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch 2 times, most recently from f3c994c to 1341cdf Compare January 15, 2025 19:29
@runtian-zhou runtian-zhou changed the base branch from 09-11-permission_for_framework to 09-09-add_perimission_checks_to_object January 15, 2025 19:29
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from a164b62 to b45959f Compare January 15, 2025 19:53
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 1341cdf to e34c7da Compare January 15, 2025 19:53
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from b45959f to 4dbfcfa Compare January 15, 2025 20:20
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from e34c7da to 2b01fae Compare January 15, 2025 20:20
@runtian-zhou runtian-zhou force-pushed the 09-09-add_perimission_checks_to_object branch from 4dbfcfa to 5c551bf Compare January 15, 2025 21:12
@runtian-zhou runtian-zhou force-pushed the 01-10-create_object_with_permissioned_signer branch from 2b01fae to 75508ff Compare January 15, 2025 21:13
@runtian-zhou runtian-zhou merged commit 0154651 into 09-09-add_perimission_checks_to_object Jan 15, 2025
45 checks passed
@runtian-zhou runtian-zhou deleted the 01-10-create_object_with_permissioned_signer branch January 15, 2025 22:06
runtian-zhou added a commit that referenced this pull request Jan 15, 2025
* Create object with permissioned signer

* Update permissioned_signer.move

* Update permissioned_signer.move
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.

3 participants