Skip to content

Commit 9aba3c6

Browse files
committed
refactor: governor removed + docs fixes
1 parent c63f049 commit 9aba3c6

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

contracts/tokens/WrappedPinakion.sol

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ contract WrappedPinakion is Initializable {
2424
* @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`).
2525
*
2626
* Note that `value` may be zero.
27-
* Also note that due to continuous minting we cannot emit transfer events from the address 0 when tokens are created.
28-
* In order to keep consistency, we decided not to emit those events from the address 0 even when minting is done within a transaction.
2927
*/
3028
event Transfer(address indexed from, address indexed to, uint256 value);
3129

@@ -52,9 +50,6 @@ contract WrappedPinakion is Initializable {
5250
/// @dev Number of decimals of the token.
5351
uint8 public decimals;
5452

55-
/// @dev The contract's governor.
56-
address public governor;
57-
5853
/// @dev The token's controller.
5954
address public controller;
6055

@@ -66,12 +61,6 @@ contract WrappedPinakion is Initializable {
6661

6762
/* Modifiers */
6863

69-
/// @dev Verifies that the sender has ability to modify governed parameters.
70-
modifier onlyByGovernor() {
71-
require(governor == msg.sender, "The caller is not the governor.");
72-
_;
73-
}
74-
7564
/// @dev Verifies that the sender has ability to modify controlled parameters.
7665
modifier onlyController() {
7766
require(controller == msg.sender, "The caller is not the controller.");
@@ -98,19 +87,11 @@ contract WrappedPinakion is Initializable {
9887
xPinakion = _xPinakion;
9988
tokenBridge = _tokenBridge;
10089

101-
governor = msg.sender;
10290
controller = msg.sender;
10391
}
10492

10593
/* External */
10694

107-
/** @dev Changes `governor` to `_governor`.
108-
* @param _governor The address of the new governor.
109-
*/
110-
function changeGovernor(address _governor) external onlyByGovernor {
111-
governor = _governor;
112-
}
113-
11495
/** @dev Changes `controller` to `_controller`.
11596
* @param _controller The new controller of the contract
11697
*/
@@ -149,7 +130,7 @@ contract WrappedPinakion is Initializable {
149130
tokenBridge.relayTokens(xPinakion, _receiver, _amount);
150131
}
151132

152-
/** @dev Transfers `_amount` to `_recipient` and withdraws accrued tokens.
133+
/** @dev Moves `_amount` tokens from the caller's account to `_recipient`.
153134
* @param _recipient The entity receiving the funds.
154135
* @param _amount The amount to tranfer in base units.
155136
*/
@@ -163,7 +144,8 @@ contract WrappedPinakion is Initializable {
163144
return true;
164145
}
165146

166-
/** @dev Transfers `_amount` from `_sender` to `_recipient` and withdraws accrued tokens.
147+
/** @dev Moves `_amount` tokens from `_sender` to `_recipient` using the
148+
* allowance mechanism. `_amount` is then deducted from the caller's allowance.
167149
* @param _sender The entity to take the funds from.
168150
* @param _recipient The entity receiving the funds.
169151
* @param _amount The amount to tranfer in base units.
@@ -249,7 +231,7 @@ contract WrappedPinakion is Initializable {
249231
emit Transfer(address(0x0), msg.sender, _amount);
250232
}
251233

252-
/** @dev Burns `_amount` of tokens and withdraws accrued tokens.
234+
/** @dev Destroys `_amount` tokens from the caller. Cannot burn locked tokens.
253235
* @param _amount The quantity of tokens to burn in base units.
254236
*/
255237
function _burn(uint256 _amount) internal {
@@ -277,11 +259,11 @@ contract WrappedPinakion is Initializable {
277259
/* Getters */
278260

279261
/**
280-
* @dev Calculates the current user accrued balance.
281-
* @param _human The submission ID.
282-
* @return The current balance.
283-
*/
284-
function balanceOf(address _human) public view returns (uint256) {
285-
return balances[_human];
262+
* @dev Gets the balance of the specified address.
263+
* @param _owner The address to query the balance of.
264+
* @return uint256 value representing the amount owned by the passed address.
265+
*/
266+
function balanceOf(address _owner) public view returns (uint256) {
267+
return balances[_owner];
286268
}
287269
}

0 commit comments

Comments
 (0)