mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 20:28:21 +00:00
Automatically merged updates to draft EIP(s) 1753 (#2568)
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
This commit is contained in:
parent
9e3ab0a2ee
commit
bbb8d7fce0
@ -43,7 +43,7 @@ This EIP seeks to define a standard that will allow for the granting and/or mana
|
|||||||
Returns the name of the permit - e.g. `"MyPermit"`.
|
Returns the name of the permit - e.g. `"MyPermit"`.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function name() public view returns (string)
|
function name() public view returns (string);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### totalSupply
|
#### totalSupply
|
||||||
@ -51,7 +51,7 @@ function name() public view returns (string)
|
|||||||
Returns the total permit supply.
|
Returns the total permit supply.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function totalSupply() public view returns (uint256)
|
function totalSupply() public view returns (uint256);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### grantAuthority
|
#### grantAuthority
|
||||||
@ -59,7 +59,7 @@ function totalSupply() public view returns (uint256)
|
|||||||
Adds an ethereum address to a white list of addresses that have authority to modify a permit.
|
Adds an ethereum address to a white list of addresses that have authority to modify a permit.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function grantAuthority(address who)
|
function grantAuthority(address who) public;
|
||||||
```
|
```
|
||||||
|
|
||||||
#### revokeAuthority
|
#### revokeAuthority
|
||||||
@ -67,7 +67,7 @@ function grantAuthority(address who)
|
|||||||
Removes an ethereum address from a white list of addresses that have authority to modify a permit.
|
Removes an ethereum address from a white list of addresses that have authority to modify a permit.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function revokeAuthority(address who)
|
function revokeAuthority(address who) public;
|
||||||
```
|
```
|
||||||
|
|
||||||
#### hasAuthority
|
#### hasAuthority
|
||||||
@ -75,7 +75,7 @@ function revokeAuthority(address who)
|
|||||||
Checks to see if the address has authority to grant or revoke permits.
|
Checks to see if the address has authority to grant or revoke permits.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function hasAuthority(address who)
|
function hasAuthority(address who) public view;
|
||||||
```
|
```
|
||||||
|
|
||||||
#### issue
|
#### issue
|
||||||
@ -99,7 +99,7 @@ function revoke(address who) public;
|
|||||||
Checks to see if an ethereum address has a valid permit.
|
Checks to see if an ethereum address has a valid permit.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function hasValid(address who) public view returns (boolean);
|
function hasValid(address who) external view returns (bool);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### purchase
|
#### purchase
|
||||||
@ -107,7 +107,7 @@ function hasValid(address who) public view returns (boolean);
|
|||||||
Allows a user to self procure a licence.
|
Allows a user to self procure a licence.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
function purchase(uint256 validFrom, uint256 validTo) public payable;
|
function purchase(uint256 validFrom, uint256 validTo) external payable;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rationale
|
## Rationale
|
||||||
@ -170,14 +170,14 @@ interface EIP1753 {
|
|||||||
string public name;
|
string public name;
|
||||||
uint256 public totalSupply;
|
uint256 public totalSupply;
|
||||||
|
|
||||||
function grantAuthority(address who);
|
function grantAuthority(address who) public;
|
||||||
function revokeAuthority(address who);
|
function revokeAuthority(address who) public;
|
||||||
function hasAuthority(address who) pure public returns (bool);
|
function hasAuthority(address who) external view returns (bool);
|
||||||
|
|
||||||
function issue(address who, uint256 from, uint256 to) public;
|
function issue(address who, uint256 from, uint256 to) external;
|
||||||
function revoke(address who) public;
|
function revoke(address who) public;
|
||||||
|
|
||||||
function hasValid(address who) public view returns (boolean);
|
function hasValid(address who) external view returns (bool);
|
||||||
function purchase(uint256 validFrom, uint256 validTo) public payable;
|
function purchase(uint256 validFrom, uint256 validTo) public payable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ contract EIP is EIP1753 {
|
|||||||
delete _authorities[who];
|
delete _authorities[who];
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasAuthority(address who) public view returns (bool) {
|
function hasAuthority(address who) external view returns (bool) {
|
||||||
return _authorities[who] == true;
|
return _authorities[who] == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,11 +223,11 @@ contract EIP is EIP1753 {
|
|||||||
delete _holders[who];
|
delete _holders[who];
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasValid(address who) public view returns (bool) {
|
function hasValid(address who) external view returns (bool) {
|
||||||
return _holders[who].start > now && _holders[who].end < now;
|
return _holders[who].start > now && _holders[who].end < now;
|
||||||
}
|
}
|
||||||
|
|
||||||
function purchase(uint256 validFrom, uint256 validTo) public payable {
|
function purchase(uint256 validFrom, uint256 validTo) external payable {
|
||||||
require(msg.value == 1 ether, "Incorrect fee");
|
require(msg.value == 1 ether, "Incorrect fee");
|
||||||
issue(msg.sender, from, to);
|
issue(msg.sender, from, to);
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ contract EIP is EIP1753 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
modifier onlyAuthority() {
|
modifier onlyAuthority() {
|
||||||
require(hasAuthority(msg.sender) == true, "Only an authority can perform this function");
|
require(hasAuthority(msg.sender), "Only an authority can perform this function");
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user