Closed carlossampol closed 5 years ago
Auditing time 2 days
@MrCrambo assigned
auditing time: 1 day
@RideSolo assigned
Auditing time: 1 day.
My report is finished.
My report is finished
@danbogd assigned
SafePost smart contract security audit report performed by Callisto Security Audit Department
In total, 5 issues were reported including:
No critical security issues were found.
SPAccount
contract contain a fallback function that allows ether deposit to the contract, but no other function inside the contract is implemented to withdraw ether from it.
spaccount_v.3_solidity.js Line 19.
function () public payable {}
ERC20 standard: "A token contract which creates new tokens SHOULD trigger a Transfer event with the _from address set to 0x0 when tokens are created". the same can be deducted when burning tokens.
This issue is applicable for SafePost
contract constructor, where the initial supply is assigned but no Transfer
event is emitted.
In burn
and burnFrom
a transfer event should also be emitted from the msg.sender
to address(0)
with a value equal to the burned tokens.
safepost_solidity.js Line 34.
function SafePost(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
Following ERC20 standard transfer function is defined as follow: transfer(address _to, uint256 _value) public returns (bool success)
, when the implemented transfer function does not return any boolean.
safepost_solidity.js Line 60.
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
Add into the function transfer(address _to, ... )
and transferFrom
the following code, to avoid transfers to the contract address:
require( _to != address(this) );
There are no zero address checking in functions transfer
, transferFrom
, sendToAddress
and withdrawToAddress
.
The audited smart contract can be deployed. Only low severity issues were found during the audit.
https://gist.github.com/yuriy77k/46cf54b64d7bbb67963db8c936c7afb8
https://gist.github.com/yuriy77k/c414ea2abe86024ec0af5bafdb063481
https://gist.github.com/yuriy77k/8f0d15550323ff3b4e7581ac11735f58
Audit request
STAMP issued by this smart contract enable users to pay different kinds of services to SafePost such as sending messages and documents a safe way.
Source code
https://www.dropbox.com/sh/63x0i354l1qm0bc/AAA8bXICnnMnd8t53TETJt52a?dl=0
Disclosure policy
info@token-economics.eu
Platform
Ethereum
Number of lines:
98