Skip to content

feat: add get_minter() view to token contract - #17

Merged
IlyasRidhuan merged 1 commit into
stack/arc403-interfacefrom
stack/get-minter
Aug 12, 2026
Merged

feat: add get_minter() view to token contract#17
IlyasRidhuan merged 1 commit into
stack/arc403-interfacefrom
stack/get-minter

Conversation

@alejoamiras

@alejoamiras alejoamiras commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What

Adds get_minter() public view to the Token contract. minter was the only documented storage field without a getter — name, symbol, decimals, total_supply, and auth_contract all have one, and MultiToken already exposes get_minter().

The bug codex caught

PublicImmutable::read() asserts initialization in aztec-nr v5.1.0, and constructor_with_initial_supply never initialized minter — so the new getter (and a doc claim that it returns zero) would have reverted for initial-supply tokens. Fix: that constructor now explicitly initializes minter to the zero address, matching how auth_contract is handled. Side effect is strictly clarifying: mint functions on initial-supply tokens now revert with "caller is not minter" instead of "Trying to read from uninitialized PublicImmutable"; no authorization is weakened (verified in codex re-review).

Validation

aztec compile ✓ · full token_contract Noir suite (81 tests) ✓, including two new view tests covering both constructor paths.

🤖 Generated with Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

minter was the only documented storage field without a view getter —
every other field (name, symbol, decimals, total_supply, auth_contract)
has one, and MultiToken already exposes get_minter(). Add the getter,
README entry, and a view test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IlyasRidhuan
IlyasRidhuan merged commit 324103b into main Aug 12, 2026
7 checks passed
@alejoamiras
alejoamiras deleted the stack/get-minter branch August 12, 2026 17:00
@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
AMD EPYC 7763 64-Core Processor 4 16 GiB x64

Contract: escrow

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
(partial) withdraw 486,936 486,936 3,744 3,744 587,800 587,800 11,780 13,915 +2,135 (+18.1%)
withdraw 331,210 331,210 832 832 499,700 499,700 9,505 11,312 +1,807 (+19.0%)
withdraw_nft 378,517 378,517 1,440 1,440 527,400 527,400 10,465 12,392 +1,927 (+18.4%)

Contract: logic

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
get_escrow 390,359 390,359 192 192 456,000 456,000 10,565 12,633 +2,068 (+19.6%)
secret_key_to_public_keys 387,718 387,718 192 192 456,000 456,000 10,568 12,453 +1,885 (+17.8%)
share_escrow 303,989 303,989 1,952 1,952 520,700 520,700 9,270 11,108 +1,838 (+19.8%)

Contract: multitoken

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
burn_private 260,810 260,810 832 832 499,700 499,700 8,482 9,978 +1,496 (+17.6%)
burn_public 223,823 223,823 416 416 638,292 638,292 8,166 9,643 +1,477 (+18.1%)
initialize_transfer_commitment 225,077 225,077 768 768 474,500 474,500 8,142 9,625 +1,483 (+18.2%)
mint_to_private 297,577 297,577 1,408 1,408 511,400 511,400 9,173 10,887 +1,714 (+18.7%)
mint_to_public 223,823 223,823 416 416 637,800 637,800 8,153 9,734 +1,581 (+19.4%)
transfer_private_to_commitment 264,328 264,328 1,024 1,024 511,400 511,400 8,525 10,046 +1,521 (+17.8%)
transfer_private_to_private 337,261 337,261 2,048 2,048 555,100 555,100 9,590 11,405 +1,815 (+18.9%)
transfer_private_to_public 307,363 307,363 1,056 1,056 714,677 714,677 9,186 10,916 +1,730 (+18.8%)
transfer_public_to_commitment 223,823 223,823 640 640 663,516 663,516 8,170 9,675 +1,505 (+18.4%)
transfer_public_to_private 298,128 298,128 1,024 1,024 683,958 683,958 9,096 10,760 +1,664 (+18.3%)
transfer_public_to_public 223,823 223,823 480 480 673,505 673,505 8,259 9,707 +1,448 (+17.5%)

Contract: nft

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
burn_private 275,257 275,257 416 416 661,052 661,052 8,844 10,605 +1,761 (+19.9%)
burn_public 223,823 223,823 448 448 670,034 670,034 8,138 9,702 +1,564 (+19.2%)
mint_to_private 341,050 341,050 1,600 1,600 735,342 735,342 9,629 11,498 +1,869 (+19.4%)
mint_to_public 223,823 223,823 448 448 670,718 670,718 8,109 9,649 +1,540 (+19.0%)
transfer_private_to_private 249,719 249,719 832 832 499,700 499,700 8,363 9,933 +1,570 (+18.8%)
transfer_private_to_public 275,286 275,286 416 416 659,258 659,258 8,873 10,466 +1,593 (+18.0%)
transfer_public_to_private 292,460 292,460 992 992 683,268 683,268 9,031 10,740 +1,709 (+18.9%)
transfer_public_to_public 223,823 223,823 384 384 633,285 633,285 8,149 9,648 +1,499 (+18.4%)

Contract: token

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
burn_private 303,652 303,652 1,024 1,024 713,843 713,957 +114 (+0.0%) 9,189 10,839 +1,650 (+18.0%)
burn_public 223,823 223,823 448 448 672,518 672,632 +114 (+0.0%) 8,165 9,743 +1,578 (+19.3%)
initialize_transfer_commitment 225,077 225,077 768 768 474,500 474,500 8,102 9,613 +1,511 (+18.6%)
mint_to_private 355,289 355,289 2,144 2,144 737,956 738,070 +114 (+0.0%) 9,857 11,727 +1,870 (+19.0%)
mint_to_public 223,823 223,823 448 448 672,113 672,227 +114 (+0.0%) 8,251 9,706 +1,455 (+17.6%)
transfer_private_to_commitment 260,673 260,673 992 992 511,400 511,400 8,519 10,101 +1,582 (+18.6%)
transfer_private_to_private 344,855 344,855 2,592 2,592 557,600 557,600 9,705 11,534 +1,829 (+18.8%)
transfer_private_to_public 303,708 303,708 1,024 1,024 713,990 714,023 +33 (+0.0%) 9,193 10,943 +1,750 (+19.0%)
transfer_private_to_public_with_commitment 308,509 308,509 1,600 1,600 747,290 747,323 +33 (+0.0%) 9,217 11,039 +1,822 (+19.8%)
transfer_public_to_commitment 223,823 223,823 576 576 662,496 662,529 +33 (+0.0%) 8,175 9,692 +1,517 (+18.6%)
transfer_public_to_private 296,092 296,092 992 992 683,271 683,304 +33 (+0.0%) 9,121 10,815 +1,694 (+18.6%)
transfer_public_to_public 223,823 223,823 448 448 672,515 672,548 +33 (+0.0%) 8,160 9,760 +1,600 (+19.6%)

Contract: vault

🚦 Function Gates DA Gas L2 Gas Proving Time (ms)
Base PR Diff Base PR Diff Base PR Diff Base PR Diff
deposit_private_to_private 508,340 508,340 1,312 1,312 878,035 878,248 +213 (+0.0%) 11,935 14,291 +2,356 (+19.7%)
deposit_private_to_private_exact 612,065 612,065 1,888 1,888 915,103 915,316 +213 (+0.0%) 13,524 16,104 +2,580 (+19.1%)
deposit_private_to_public 436,085 436,085 768 768 862,060 862,273 +213 (+0.0%) 11,027 13,099 +2,072 (+18.8%)
deposit_public_to_private 424,713 424,713 1,984 1,984 964,832 965,045 +213 (+0.0%) 10,911 13,011 +2,100 (+19.2%)
deposit_public_to_private_exact 424,724 424,724 1,952 1,952 949,256 949,469 +213 (+0.0%) 10,909 13,083 +2,174 (+19.9%)
deposit_public_to_public 223,823 223,823 832 832 897,350 897,563 +213 (+0.0%) 8,169 9,705 +1,536 (+18.8%)
issue_private_to_private_exact 612,065 612,065 1,888 1,888 915,763 915,976 +213 (+0.0%) 13,507 16,238 +2,731 (+20.2%)
issue_private_to_public_exact 484,820 484,820 1,344 1,344 899,785 899,998 +213 (+0.0%) 11,683 13,905 +2,222 (+19.0%)
issue_public_to_private 346,165 346,165 1,376 1,376 921,448 921,661 +213 (+0.0%) 9,724 11,610 +1,886 (+19.4%)
issue_public_to_public 223,823 223,823 832 832 898,040 898,253 +213 (+0.0%) 8,129 9,681 +1,552 (+19.1%)
redeem_private_to_private_exact 614,859 614,859 1,888 1,888 915,610 915,823 +213 (+0.0%) 13,587 16,202 +2,615 (+19.2%)
redeem_private_to_public 436,028 436,028 768 768 862,504 862,717 +213 (+0.0%) 11,016 13,244 +2,228 (+20.2%)
redeem_public_to_private_exact 427,575 427,575 1,952 1,952 949,577 949,790 +213 (+0.0%) 11,027 13,108 +2,081 (+18.9%)
redeem_public_to_public 223,823 223,823 832 832 897,872 898,085 +213 (+0.0%) 8,161 9,747 +1,586 (+19.4%)
withdraw_private_to_private 511,134 511,134 1,312 1,312 878,245 878,458 +213 (+0.0%) 11,960 14,375 +2,415 (+20.2%)
withdraw_private_to_private_exact 614,859 614,859 1,888 1,888 915,556 915,769 +213 (+0.0%) 13,546 16,259 +2,713 (+20.0%)
withdraw_private_to_public_exact 484,763 484,763 1,344 1,344 900,019 900,232 +213 (+0.0%) 11,701 14,044 +2,343 (+20.0%)
withdraw_public_to_private 440,832 440,832 2,528 2,528 967,143 967,356 +213 (+0.0%) 11,113 13,385 +2,272 (+20.4%)
withdraw_public_to_public 223,823 223,823 832 832 898,175 898,388 +213 (+0.0%) 8,132 9,812 +1,680 (+20.7%)

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