Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
poa changes + misc coherence
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Le Bars committed Aug 4, 2018
1 parent 69d47e0 commit fb26c20
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
2 changes: 1 addition & 1 deletion contracts/RougeFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 8 additions & 9 deletions contracts/SimpleRougeCampaign.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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];
}
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions truffle.js
Original file line number Diff line number Diff line change
@@ -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
}
}
};

0 comments on commit fb26c20

Please sign in to comment.