8000 Airdrop | completion flags by FloppyDisck · Pull Request #127 · securesecrets/shade · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Airdrop | completion flags #127

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

Merged
merged 7 commits into from
Nov 16, 2021
Merged

Airdrop | completion flags #127

merged 7 commits into from
Nov 16, 2021

Conversation

FloppyDisck
Copy link
Contributor

Added completion flags for airdrop

The flags can be added before and after deployment, each flag points to an address which will be the contracts that notify the airdrop contract when a user is eligible for that portion of the airdrop

Comment on lines +34 to +36
if count > Uint128(100) {
return Err(StdError::GenericErr { msg: "tasks above 100%".to_string(), backtrace: None })
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you switch to decimal this can be

if count > Decimal::one() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You would need to convert everything to decimal for that since Uint128 and Decimal dont match when comparing

Copy link
Collaborator

Choose a reason for hiding this comment

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

But for the purposes of a percentage, integer precision is entirely inadequate and is guaranteed to introduce error into the calculation. It also disallows having any kind of resolution when setting/using these values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering the amount is already in uShade, any "decimal" value will still be ignored when claiming so it wouldn't make a difference

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see no reason for this to be integers, the calculation will be inaccurate and there will be lots of error. But if that doesn't matter I will approve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does matter but decimals doesn't provide a solution for when the number is inevitably converted back into Uint128. Maybe a final calculation once that user's airdrop completion is 100% could give him the possible 1-2 uToken loss

# Conflicts:
#	contracts/airdrop/src/contract.rs
#	contracts/airdrop/src/handle.rs
#	contracts/airdrop/src/state.rs
#	packages/network_integration/src/contract_helpers/initializer.rs
#	packages/network_integration/src/contract_helpers/minter.rs
#	packages/network_integration/src/contract_helpers/stake.rs
    
@FloppyDisck FloppyDisck merged commit d14742a into dev Nov 16, 2021
@FloppyDisck FloppyDisck deleted the airdrop/completion-flags branch November 16, 2021 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
airdrop Airdrop contract
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0