-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExampleTargetContract.sol
35 lines (31 loc) · 1.2 KB
/
ExampleTargetContract.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pragma solidity ^0.4.0;
import "./environment.sol";
/**
* An example base class for contract that is going to be bug-bountied.
* You do not need to use this class for PYMWYCI to work.
*
* NOTE however: it is important that the contract does not use the following
* directly:
* block.blockhash, block.coinbase, block.difficulty, block.gaslimit, block.number
* block.timestamp and now.
* Instead it should use the injected _env variable.
*
* It is also advisable for a bountable contract to publicily expose as much of the
* state variables as is feasible, because that will let its respective ContractTest
* verify its validity.
*/
contract ExampleTargetContract {
EnvironmentContractInterface public env;
address public owner;
/**
* @param _env the environment to use (usually testing or prod)
* @param opt_owner if supplied, overrides the msg.sender. Use during bounties
*
*/
function BountableContract(EnvironmentContractInterface _env, address opt_owner) {
env = _env;
// Note we dependency-inject the owner, to allow a Challenger to become
// the owner of a contract.
owner = (opt_owner != 0) ? opt_owner : msg.sender;
}
}