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

Introduce supply mapping #1932

Open
wants to merge 10 commits into
base: testnet3
Choose a base branch
from
Open

Introduce supply mapping #1932

wants to merge 10 commits into from

Conversation

raychu86
Copy link
Contributor

@raychu86 raychu86 commented Aug 24, 2023

Motivation

This PR introduces the supply mapping to credits.aleo and handles the updates in the VM::speculate and VM::finalize operations.

Each of the following conditions will update the supply mapping:

  • Ratify::Genesis
  • Ratify::BlockReward
  • Ratify::PuzzleReward
  • Specific transactions
    • bond_public
    • unbond_public
    • transfer_private_to_public
    • transfer_public_to_private
    • fee_private
    • fee_public

@raychu86 raychu86 marked this pull request as ready for review August 24, 2023 20:43
@@ -309,6 +309,44 @@ impl<N: Network> Transition<N> {
self.program_id.to_string() == "credits.aleo" && self.function_name.to_string() == "unbond"
}

/// Returns `true` if this is a `bond_public` transition.
Copy link
Contributor

Choose a reason for hiding this comment

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

Frankly speaking I have no idea why this function is marked as inline because there are so much code inside of them including at least 4 memory allocations.

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.

None yet

2 participants