diff --git a/README.md b/README.md index bd2dd9e..9c6e730 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ WARNING : this is NON AUDITED code. Use on testnet or with extreme caution. The project use the truffle framework (http://truffleframework.com/) +## Versioning + +The project follows Semantic Versioning 2.0.0 : see https://semver.org/ + ## How to run tests : ### 1. install truffle : diff --git a/contracts/RougeFactory.sol b/contracts/RougeFactory.sol index 0f5d4bd..0791299 100644 --- a/contracts/RougeFactory.sol +++ b/contracts/RougeFactory.sol @@ -14,7 +14,7 @@ import "./RougeRegistry.sol"; contract RougeFactory is RougeRegistry { - bytes8 public version = '0.10'; + bytes8 public version = '0.11.0'; // The Rouge Token contract address RGETokenInterface public rge; diff --git a/contracts/SimpleRougeCampaign.sol b/contracts/SimpleRougeCampaign.sol index e21f2ee..c216b08 100644 --- a/contracts/SimpleRougeCampaign.sol +++ b/contracts/SimpleRougeCampaign.sol @@ -12,7 +12,7 @@ import "./RougeFactoryInterface.sol"; contract SimpleRougeCampaign { - bytes8 public version = '0.10'; + bytes8 public version = '0.11.0'; // The Rouge Token contract address RGETokenInterface public rge; @@ -44,7 +44,7 @@ contract SimpleRougeCampaign { factory = RougeFactoryInterface(_factory); } - enum Authorization { Acquisition, Redemption } + enum Authorization { Issuance, Acquisition, Redemption } mapping (address => mapping (uint => bool)) public canAuthorize; @@ -113,9 +113,9 @@ contract SimpleRougeCampaign { _; } - mapping (address => bool) acquisitionRegister; + mapping (address => bool) public acquisitionRegister; - function hasNote(address _bearer) constant public returns (bool yes) { + function hasNote(address _bearer) public view returns (bool yes) { require(_bearer != issuer); /* RULE issuer and bearer need to be diffrent */ return acquisitionRegister[_bearer]; } @@ -161,18 +161,17 @@ contract SimpleRougeCampaign { acquisitionRegister[_to] = true; } - mapping (address => bool) redemptionRegister; + mapping (address => bool) public redemptionRegister; - function hasRedeemed(address _bearer) constant public returns (bool yes) { - require(_bearer != issuer); - require(hasNote(_bearer)); + function hasRedeemed(address _bearer) public view returns (bool yes) { + /* require(_bearer != issuer); already tested with hasNote */ return redemptionRegister[_bearer]; } event Redemption(address indexed bearer); function redemption(address _bearer) CampaignOpen private returns (bool success) { - require(_bearer != issuer); + require(hasNote(_bearer)); require(!hasRedeemed(_bearer)); redeemed += 1; redemptionRegister[_bearer] = true; diff --git a/truffle.js b/truffle.js index 2100a2e..e50b1f8 100644 --- a/truffle.js +++ b/truffle.js @@ -1,9 +1,14 @@ module.exports = { networks: { - // development: { + // local: { // host: "localhost", // port: 8545, // network_id: "*" // Match any network id - // } + // }, + sokol: { + host: " https://sokol-trace.poa.network", //https://sokol.poa.network", + port: 443, + network_id: "*" // Match any network id + } } };