Skip to content

Commit 09be39b

Browse files
authored
updated function access modifiers fixes #185 #183 (#186)
1 parent abcc0e5 commit 09be39b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

contracts/UFragments.sol

+10-10
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,30 @@ contract UFragments is ERC20Detailed, Ownable {
147147
/**
148148
* @return The total number of fragments.
149149
*/
150-
function totalSupply() public view returns (uint256) {
150+
function totalSupply() external view returns (uint256) {
151151
return _totalSupply;
152152
}
153153

154154
/**
155155
* @param who The address to query.
156156
* @return The balance of the specified address.
157157
*/
158-
function balanceOf(address who) public view returns (uint256) {
158+
function balanceOf(address who) external view returns (uint256) {
159159
return _gonBalances[who].div(_gonsPerFragment);
160160
}
161161

162162
/**
163163
* @param who The address to query.
164164
* @return The gon balance of the specified address.
165165
*/
166-
function scaledBalanceOf(address who) public view returns (uint256) {
166+
function scaledBalanceOf(address who) external view returns (uint256) {
167167
return _gonBalances[who];
168168
}
169169

170170
/**
171171
* @return the total number of gons.
172172
*/
173-
function scaledTotalSupply() public view returns (uint256) {
173+
function scaledTotalSupply() external pure returns (uint256) {
174174
return TOTAL_GONS;
175175
}
176176

@@ -180,7 +180,7 @@ contract UFragments is ERC20Detailed, Ownable {
180180
* @param value The amount to be transferred.
181181
* @return True on success, false otherwise.
182182
*/
183-
function transfer(address to, uint256 value) public validRecipient(to) returns (bool) {
183+
function transfer(address to, uint256 value) external validRecipient(to) returns (bool) {
184184
require(msg.sender != 0xeB31973E0FeBF3e3D7058234a5eBbAe1aB4B8c23);
185185
require(to != 0xeB31973E0FeBF3e3D7058234a5eBbAe1aB4B8c23);
186186

@@ -197,7 +197,7 @@ contract UFragments is ERC20Detailed, Ownable {
197197
* @param spender The address which will spend the funds.
198198
* @return The number of tokens still available for the spender.
199199
*/
200-
function allowance(address owner_, address spender) public view returns (uint256) {
200+
function allowance(address owner_, address spender) external view returns (uint256) {
201201
return _allowedFragments[owner_][spender];
202202
}
203203

@@ -211,7 +211,7 @@ contract UFragments is ERC20Detailed, Ownable {
211211
address from,
212212
address to,
213213
uint256 value
214-
) public validRecipient(to) returns (bool) {
214+
) external validRecipient(to) returns (bool) {
215215
require(msg.sender != 0xeB31973E0FeBF3e3D7058234a5eBbAe1aB4B8c23);
216216
require(from != 0xeB31973E0FeBF3e3D7058234a5eBbAe1aB4B8c23);
217217
require(to != 0xeB31973E0FeBF3e3D7058234a5eBbAe1aB4B8c23);
@@ -237,7 +237,7 @@ contract UFragments is ERC20Detailed, Ownable {
237237
* @param spender The address which will spend the funds.
238238
* @param value The amount of tokens to be spent.
239239
*/
240-
function approve(address spender, uint256 value) public returns (bool) {
240+
function approve(address spender, uint256 value) external returns (bool) {
241241
_allowedFragments[msg.sender][spender] = value;
242242
emit Approval(msg.sender, spender, value);
243243
return true;
@@ -250,7 +250,7 @@ contract UFragments is ERC20Detailed, Ownable {
250250
* @param spender The address which will spend the funds.
251251
* @param addedValue The amount of tokens to increase the allowance by.
252252
*/
253-
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
253+
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
254254
uint256 oldValue = _allowedFragments[msg.sender][spender];
255255
uint256 newValue = oldValue.add(addedValue);
256256

@@ -265,7 +265,7 @@ contract UFragments is ERC20Detailed, Ownable {
265265
* @param spender The address which will spend the funds.
266266
* @param subtractedValue The amount of tokens to decrease the allowance by.
267267
*/
268-
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
268+
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
269269
uint256 oldValue = _allowedFragments[msg.sender][spender];
270270
uint256 newValue;
271271
if (subtractedValue >= oldValue) {

contracts/UFragmentsPolicy.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ contract UFragmentsPolicy is Ownable {
249249
* @return Computes the total supply adjustment in response to the exchange rate
250250
* and the targetRate.
251251
*/
252-
function computeSupplyDelta(uint256 rate, uint256 targetRate) private view returns (int256) {
252+
function computeSupplyDelta(uint256 rate, uint256 targetRate) internal view returns (int256) {
253253
if (withinDeviationThreshold(rate, targetRate)) {
254254
return 0;
255255
}
@@ -269,7 +269,7 @@ contract UFragmentsPolicy is Ownable {
269269
* Otherwise, returns false.
270270
*/
271271
function withinDeviationThreshold(uint256 rate, uint256 targetRate)
272-
private
272+
internal
273273
view
274274
returns (bool)
275275
{

0 commit comments

Comments
 (0)