reorganize examples into folder
This commit is contained in:
12
contracts/examples/GoodFailEarly.sol
Normal file
12
contracts/examples/GoodFailEarly.sol
Normal file
@ -0,0 +1,12 @@
|
||||
contract GoodFailEarly {
|
||||
|
||||
uint constant DEFAULT_SALARY = 50000;
|
||||
mapping(string => uint) nameToSalary;
|
||||
|
||||
function getSalary(string name) constant returns (uint) {
|
||||
if (bytes(name).length == 0) throw;
|
||||
if (nameToSalary[name] == 0) throw;
|
||||
|
||||
return nameToSalary[name];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user