Poor code quality leads to unpredictable behavior. From a user's perspective that often manifests itself as poor usability. For an attacker it provides an opportunity to stress the system in unexpected ways.
public class Totaller {
private int total;
public int total() {
...
}
}
hardcap
of the token sale.
contract Tokensale {
uint hardcap = 10000 ether;
function Tokensale() { }
function fetchCap() public constant returns(uint) {
return hardcap;
}
}
contract Presale is Tokensale {
uint hardcap = 1000 ether;
function Presale() Tokensale() { }
}
synchronized(this) { }
int un$afe;
r
and then overwrites the value without using it.
int r = getNum();
r = getNewNum(buf);
r
and then overwrites the value without using it.
int r = getNum();
r = getNewNum(buf);
r
and then overwrites the value without using it.
r = getName();
r = getNewBuffer(buf);
r
and then overwrites the value without using it.
r = getName();
r = getNewBuffer(buf);
i
) being used twice. The variable j
is never used.
int i,j;
for (i=0; i < outer; i++) {
for (i=0; i < inner; i++) {
...
var1
of type A
but never uses it.
contract Base {
struct A { uint a; }
}
contract DerivedA is Base {
A var1 = A(1);
int internal j = 500;
function call(int a) public {
assign1(a);
}
function assign3(A memory x) public returns (uint) {
return g[1] + x.a + uint(j);
}
}