-
Notifications
You must be signed in to change notification settings - Fork 7
OIP-draft add exists to UtilityTokenInterface
#5
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
Open
benjaminbollen
wants to merge
1
commit into
OpenST:master
Choose a base branch
from
benjaminbollen:ut-exists
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| oip: <to be assigned> | ||
| title: <Staking Beneficiary Exists> | ||
| author: <Benjamin Bollen (@benjaminbollen)> | ||
| discussions-to: <discuss.openst.org> | ||
| status: Draft | ||
| type: <Standards Track> | ||
| category (*only required for Standard Track): <Gateway> | ||
| created: <2018-12-05> | ||
| requires (*optional): <OIP number(s)> | ||
| replaces (*optional): <OIP number(s)> | ||
| --- | ||
|
|
||
| ## Simple Summary | ||
| <!--"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the OIP.--> | ||
| Utility Token should expose an interface `UT.exists(address) returns bool` so | ||
| that cogateway can `require(UT.exists(_beneficiary))` on `confirmStakingIntent`. | ||
| This blocks a stake-and-mint operation to confirm if `exists(beneficiary)` | ||
| returns false, and hence the operation can be reverted if erroneously | ||
| initiated for a non-existant beneficiary. | ||
|
|
||
| ## Abstract | ||
| <!--A short (~200 word) description of the technical issue being addressed.--> | ||
| By default all addresses exist in the Ethereum specification. For internal | ||
| token economies addresses that are not internal should return `false` | ||
| for `UT.exists`. By including this check on `cogateway.confirmStakingIntent`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| a `gateway.stake` for a non-internal beneficiary can either be reverted (or | ||
| the beneficiary can be registered as an internal actor on the utility token). | ||
| This removes a grid-lock state where the tokens would have been confirmed to be | ||
| minted, but cannot be minted because the beneficiary is not registered as an | ||
| internal actor. | ||
|
|
||
|
|
||
| ## Motivation | ||
| <!--The motivation is critical for OIPs that want to change the OpenST protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the OIP solves. OIP submissions without sufficient motivation may be rejected outright.--> | ||
| This dead-lock state of confirmed-unmintable tokens has been identified before, | ||
| and should be resolved. | ||
|
|
||
| ## Specification | ||
| <!--The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations.--> | ||
|
|
||
| Extend the Utility Token interface with `exists`. | ||
|
|
||
| ```solidity | ||
| interface UtilityToken { | ||
| function increaseSupply( | ||
| address _beneficiary, | ||
| uint256 _amount | ||
| ) | ||
| external | ||
| returns (bool success_); | ||
|
|
||
| function decreaseSupply( | ||
| uint256 _amount | ||
| ) | ||
| external | ||
| returns (bool success_); | ||
|
|
||
| function exists( | ||
| address _actor | ||
| ) | ||
| returns (bool exists_); | ||
| } | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove brackets when adding actual values that replace the placeholders.