Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up contracts #3

Merged
merged 30 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1b56837
Hardhat and npm setup.
adlerjohn Nov 8, 2021
ec1863f
fmt
adlerjohn Nov 8, 2021
8823f12
Remove oz
adlerjohn Nov 8, 2021
6ccf2a3
Remove hh
adlerjohn Nov 8, 2021
d1f3584
Move to docs.
adlerjohn Nov 8, 2021
a7006fa
Move contracts.
adlerjohn Nov 8, 2021
5921d21
fmt
adlerjohn Nov 8, 2021
ce63ad0
Fix imports.
adlerjohn Nov 8, 2021
7184338
Add deploy script.
adlerjohn Nov 8, 2021
179807d
Refactoring.
adlerjohn Nov 13, 2021
371b1d6
Refactor validator set updates.
adlerjohn Nov 13, 2021
70d4b47
Refactor message submission.
adlerjohn Nov 14, 2021
6d973fd
Fix test constructor visibility.
adlerjohn Nov 14, 2021
a983628
Update gitignore.
adlerjohn Nov 14, 2021
964c490
Cleanup.
adlerjohn Nov 14, 2021
d2d6c7d
Fix comment.
adlerjohn Nov 14, 2021
622fa15
Remove redundant check.
adlerjohn Nov 14, 2021
adf4a69
Cleanup naming.
adlerjohn Nov 14, 2021
fc88c2b
Rename.
adlerjohn Nov 15, 2021
c59a1f7
Rename.
adlerjohn Nov 15, 2021
f0f62d6
Update solc version to 0.8.10.
adlerjohn Nov 15, 2021
d2084f3
Update solc version to 0.8.10.
adlerjohn Nov 15, 2021
858f1f9
Improve documentation of initial validator set in constructor.
adlerjohn Nov 15, 2021
dc67c26
Refactor domain separators as constants.
adlerjohn Nov 15, 2021
5578c2c
Merge branch 'master' into adlerjohn/contract_mods
adlerjohn Nov 15, 2021
db1fb34
Clean up.
adlerjohn Nov 15, 2021
7a92b9e
Refactor.
adlerjohn Nov 15, 2021
334ed25
Clean up comment.
adlerjohn Nov 15, 2021
cdb3dce
Improve docs and naming.
adlerjohn Nov 15, 2021
37b23cb
Add TODO.
adlerjohn Nov 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions ethereum/solidity/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
artifacts
build
cache
.coverage_*
coverage
**/typechain/**/*
node_modules
5 changes: 5 additions & 0 deletions ethereum/solidity/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
.coverage_*
coverage
**/typechain/**/*
node_modules
32 changes: 32 additions & 0 deletions ethereum/solidity/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "preserve"
}
},
{
"files": ["*.js", "*.ts"],
"options": {
"printWidth": 120,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "es5"
}
},
{
"files": ["*.js", "*.ts", "*.json"],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "./Initializable.sol";

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";

/*
* @dev Provides information about the current execution context, including the
Expand All @@ -18,8 +19,8 @@ abstract contract ContextUpgradeable is Initializable {
__Context_init_unchained();
}

function __Context_init_unchained() internal initializer {
}
function __Context_init_unchained() internal initializer {}

function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
Expand All @@ -28,5 +29,6 @@ abstract contract ContextUpgradeable is Initializable {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}

uint256[50] private __gap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

pragma solidity ^0.8.0;

import "./utils/ContextUpgradeable.sol";
import "./utils/Initializable.sol";
import "./ContextUpgradeable.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";

/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
Expand Down Expand Up @@ -63,23 +64,23 @@ abstract contract OwnableUpgradeableWithExpiry is Initializable, ContextUpgradea
_renounceOwnership();
}

/**
/**
* @dev Get the timestamp of ownership expiry.
* @return The timestamp of ownership expiry.
*/
function getOwnershipExpiryTimestamp() public view returns (uint256) {
return _deployTimestamp + 52 weeks;
return _deployTimestamp + 52 weeks;
}

/**
* @dev Check if the contract ownership is expired.
* @return True if the contract ownership is expired.
*/
function isOwnershipExpired() public view returns (bool) {
return block.timestamp > getOwnershipExpiryTimestamp();
return block.timestamp > getOwnershipExpiryTimestamp();
}

/**
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called after ownership is expired.
*/
Expand All @@ -104,4 +105,4 @@ abstract contract OwnableUpgradeableWithExpiry is Initializable, ContextUpgradea
}

uint256[49] private __gap;
}
}
Loading