test imports

This commit is contained in:
Iuri Matias 2017-07-16 14:11:37 -04:00
parent fd5eca6856
commit 763a864e89
3 changed files with 50 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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;
} }

View File

@ -17,6 +17,9 @@
], ],
"gas": "auto", "gas": "auto",
"contracts": { "contracts": {
"Ownable": {
"deploy": false
},
"SimpleStorage": { "SimpleStorage": {
"args": [ "args": [
100 100