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

[Spec] Delegation pool spec #23

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Open

Conversation

axiongsupra
Copy link

No description provided.

@axiongsupra axiongsupra changed the base branch from integrate_consensus_key to dev August 8, 2024 00:02
Comment on lines +97 to +111
spec initialize_delegation_pool {
pragma verify = true;
include stake::ResourceRequirement;
/// [high-level-req-1]
let owner_address = signer::address_of(owner);
let seed = spec_create_resource_account_seed(delegation_pool_creation_seed);
let resource_address = account::spec_create_resource_address(owner_address, seed);
ensures exists<DelegationPoolOwnership>(TRACE(owner_address));
// ensures exists<DelegationPool>(resource_address);
// ensures exists<stake::StakePool>(TRACE(resource_address));
/// [high-level-req-2]
let signer_address = global<DelegationPool>(resource_address).stake_pool_signer_cap.account;
let pool_address_in_owner = global<DelegationPoolOwnership>(TRACE(owner_address)).pool_address;
// ensures TRACE(signer_address) == TRACE(pool_address_in_owner);
}

Choose a reason for hiding this comment

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

It seems there's no property in this block, all properties are commented out.

Comment on lines +186 to +188
spec coins_to_transfer_to_ensure_min_stake {

}

Choose a reason for hiding this comment

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

Do these empty block serve any purpose? If no, then delete.

Comment on lines +190 to +192
spec update_governanace_records_for_redeem_pending_inactive_shares {

}

Choose a reason for hiding this comment

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

Empty block

Comment on lines +194 to +199
spec buy_in_active_shares {
pragma verify = true;
let new_shares = pool_u64::amount_to_shares(pool.active_shares, coins_amount);

ensures new_shares == 0 ==> result == 0;
}

Choose a reason for hiding this comment

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

this is trivial property, perhaps we want to assert that appropriate amount of shares are actually given in active_shares pool at the end of the buy_in.

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