Skip to content

Commit

Permalink
Merge pull request #316 from CJ42/refactor/constructor
Browse files Browse the repository at this point in the history
refactor: remove `public` visibility from `constructor`s + add thousand separators to thousand numbers
  • Loading branch information
montyly authored Jul 27, 2023
2 parents 53d30dc + ecc612a commit 08a9c59
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions program-analysis/echidna/exercises/exercise1/solution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "./token.sol";
contract TestToken is Token {
address echidna = msg.sender;

constructor() public {
balances[echidna] = 10000;
constructor() {
balances[echidna] = 10_000;
}

function echidna_test_balance() public view returns (bool) {
Expand Down
4 changes: 2 additions & 2 deletions program-analysis/echidna/exercises/exercise1/template.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "./token.sol";
contract TestToken is Token {
address echidna = tx.origin;

constructor() public {
balances[echidna] = 10000;
constructor() {
balances[echidna] = 10_000;
}

function echidna_test_balance() public view returns (bool) {
Expand Down
2 changes: 1 addition & 1 deletion program-analysis/echidna/exercises/exercise2/solution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "./token.sol";
/// echidna program-analysis/echidna/exercises/exercise1/solution.sol
/// ```
contract TestToken is Token {
constructor() public {
constructor() {
pause(); // pause the contract
owner = address(0); // lose ownership
}
Expand Down
2 changes: 1 addition & 1 deletion program-analysis/echidna/exercises/exercise2/template.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "./token.sol";
/// echidna program-analysis/echidna/exercises/exercise2/template.sol
/// ```
contract TestToken is Token {
constructor() public {
constructor() {
pause(); // pause the contract
owner = address(0); // lose ownership
}
Expand Down
2 changes: 1 addition & 1 deletion program-analysis/echidna/exercises/exercise3/mintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ contract MintableToken is Token {
int256 public totalMinted;
int256 public totalMintable;

constructor(int256 totalMintable_) public {
constructor(int256 totalMintable_) {
totalMintable = totalMintable_;
}

Expand Down
4 changes: 2 additions & 2 deletions program-analysis/echidna/exercises/exercise3/solution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import "./mintable.sol";
contract TestToken is MintableToken {
address echidna = msg.sender;

constructor() public MintableToken(10000) {
constructor() MintableToken(10_000) {
owner = echidna;
}

function echidna_test_balance() public view returns (bool) {
return balances[msg.sender] <= 10000;
return balances[msg.sender] <= 10_000;
}
}
2 changes: 1 addition & 1 deletion program-analysis/echidna/exercises/exercise3/template.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ contract TestToken is MintableToken {
address echidna = msg.sender;

// TODO: update the constructor
constructor(int256 totalMintable) public MintableToken(totalMintable) {}
constructor(int256 totalMintable) MintableToken(totalMintable) {}

function echidna_test_balance() public view returns (bool) {
// TODO: add the property
Expand Down

0 comments on commit 08a9c59

Please sign in to comment.