test imports
This commit is contained in:
parent
fd5eca6856
commit
763a864e89
|
@ -0,0 +1,42 @@
|
||||||
|
pragma solidity ^0.4.11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title Ownable
|
||||||
|
* @dev The Ownable contract has an owner address, and provides basic authorization control
|
||||||
|
* functions, this simplifies the implementation of "user permissions".
|
||||||
|
*/
|
||||||
|
contract Ownable {
|
||||||
|
address public owner;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
|
||||||
|
* account.
|
||||||
|
*/
|
||||||
|
function Ownable() {
|
||||||
|
owner = msg.sender;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Throws if called by any account other than the owner.
|
||||||
|
*/
|
||||||
|
modifier onlyOwner() {
|
||||||
|
if (msg.sender != owner) {
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Allows the current owner to transfer control of the contract to a newOwner.
|
||||||
|
* @param newOwner The address to transfer ownership to.
|
||||||
|
*/
|
||||||
|
function transferOwnership(address newOwner) onlyOwner {
|
||||||
|
if (newOwner != address(0)) {
|
||||||
|
owner = newOwner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
pragma solidity ^0.4.7;
|
pragma solidity ^0.4.7;
|
||||||
contract SimpleStorage {
|
|
||||||
|
import "ownable.sol";
|
||||||
|
|
||||||
|
contract SimpleStorage is Ownable {
|
||||||
uint public storedData;
|
uint public storedData;
|
||||||
|
|
||||||
function() payable { }
|
function() payable { }
|
||||||
|
@ -12,7 +15,7 @@ contract SimpleStorage {
|
||||||
storedData = x;
|
storedData = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
function set2(uint x, uint unusedGiveWarning) {
|
function set2(uint x, uint unusedGiveWarning) onlyOwner {
|
||||||
storedData = x;
|
storedData = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
],
|
],
|
||||||
"gas": "auto",
|
"gas": "auto",
|
||||||
"contracts": {
|
"contracts": {
|
||||||
|
"Ownable": {
|
||||||
|
"deploy": false
|
||||||
|
},
|
||||||
"SimpleStorage": {
|
"SimpleStorage": {
|
||||||
"args": [
|
"args": [
|
||||||
100
|
100
|
||||||
|
|
Loading…
Reference in New Issue