diff --git a/OIPS/oip-draft_gateway_beneficiary_exists.md b/OIPS/oip-draft_gateway_beneficiary_exists.md new file mode 100644 index 0000000..02f1f9a --- /dev/null +++ b/OIPS/oip-draft_gateway_beneficiary_exists.md @@ -0,0 +1,64 @@ +--- +oip: +title: +author: +discussions-to: +status: Draft +type: +category (*only required for Standard Track): +created: <2018-12-05> +requires (*optional): +replaces (*optional): +--- + +## Simple Summary + +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 + +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`, +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 + +This dead-lock state of confirmed-unmintable tokens has been identified before, +and should be resolved. + +## Specification + + +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_); +} +```