forked from EspeoBlockchain/gardener-smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from EspeoBlockchain/feature/truffle-v5
updated truffle to v5 and solidity to 0.5.9
- Loading branch information
Showing
31 changed files
with
7,562 additions
and
3,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
contract Migrations { | ||
address public owner; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
interface OracleI { | ||
function request(string _url) external returns(bytes32 id); | ||
function delayedRequest(string _url, uint _delay) external returns(bytes32 id); | ||
function request(string calldata _url) external returns(bytes32 id); | ||
function delayedRequest(string calldata _url, uint _delay) external returns(bytes32 id); | ||
function trustedServer() external returns(address); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
interface UsingOracleI { | ||
function __callback(bytes32 _id, string _value, uint _errorCode) external; | ||
function __callback(bytes32 _id, string calldata _value, uint _errorCode) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; | ||
import "openzeppelin-solidity/contracts/access/rbac/RBAC.sol"; | ||
import "openzeppelin-solidity/contracts/access/Roles.sol"; | ||
|
||
|
||
contract Authorizable is Ownable, RBAC { | ||
contract Authorizable is Ownable { | ||
|
||
using Roles for Roles.Role; | ||
Roles.Role private _authorized; | ||
|
||
string public constant AUTHORIZED_ROLE = "authorized_role"; | ||
|
||
function grantAccessToAddress(address _authorizedAddress) public onlyOwner { | ||
addRole(_authorizedAddress, AUTHORIZED_ROLE); | ||
_authorized.add(_authorizedAddress); | ||
} | ||
|
||
function revokeAccessFromAddress(address _addressToRevoke) public onlyOwner { | ||
removeRole(_addressToRevoke, AUTHORIZED_ROLE); | ||
_authorized.remove(_addressToRevoke); | ||
} | ||
|
||
function isAuthorized(address _checkingAddress) public view returns(bool) { | ||
return _authorized.has(_checkingAddress); | ||
} | ||
|
||
modifier onlyAuthorized() { | ||
require(_authorized.has(msg.sender), "Only authorized addresses can perform this action"); | ||
_; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
/* | ||
Copyright (c) 2015-2016 Oraclize SRL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
contract OraclizeI { | ||
|
||
address public cbAddress; | ||
function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id); | ||
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id); | ||
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id); | ||
function query2_withGasLimit( | ||
uint _timestamp, | ||
string _datasource, | ||
string _arg1, | ||
string _arg2, | ||
uint _gaslimit) external payable returns (bytes32 _id); | ||
function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id); | ||
function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id); | ||
function getPrice(string _datasource) public returns (uint _dsprice); | ||
function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice); | ||
|
||
function setProofType(byte _proofType) external; | ||
|
||
function setCustomGasPrice(uint _gasPrice) external; | ||
function randomDS_getSessionPubKeyHash() external view returns(bytes32); | ||
|
||
function getPrice(string memory _datasource) public returns (uint _dsprice); | ||
|
||
function randomDS_getSessionPubKeyHash() external view returns (bytes32 _sessionKeyHash); | ||
|
||
function getPrice(string memory _datasource, uint _gasLimit) public returns (uint _dsprice); | ||
|
||
function queryN(uint _timestamp, string memory _datasource, bytes memory _argN) public payable returns (bytes32 _id); | ||
|
||
function query(uint _timestamp, string calldata _datasource, string calldata _arg) external payable returns (bytes32 _id); | ||
|
||
function query2(uint _timestamp, string memory _datasource, string memory _arg1, string memory _arg2) public payable returns (bytes32 _id); | ||
|
||
function query_withGasLimit( | ||
uint _timestamp, | ||
string calldata _datasource, | ||
string calldata _arg, | ||
uint _gasLimit) external payable returns (bytes32 _id); | ||
|
||
function queryN_withGasLimit( | ||
uint _timestamp, | ||
string calldata _datasource, | ||
bytes calldata _argN, | ||
uint _gasLimit) external payable returns (bytes32 _id); | ||
|
||
function query2_withGasLimit( | ||
uint _timestamp, | ||
string calldata _datasource, | ||
string calldata _arg1, | ||
string calldata _arg2, | ||
uint _gasLimit) external payable returns (bytes32 _id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pragma solidity ^0.4.24; | ||
pragma solidity ^0.5.0; | ||
|
||
interface UsingOraclizeI { | ||
function __callback(bytes32 _id, string _value) external; | ||
function __callback(bytes32 _id, string calldata _value) external; | ||
} |
Oops, something went wrong.