forked from aurora-is-near/aurora-engine
-
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.
* Introduce precompiles for the ETH & ERC-20 connectors. (aurora-is-near#51) * Implement generational storage with `SELFDESTRUCT` tests. (aurora-is-near#84) * Fix u128 JSON parsing & tests in the ETH connector. (aurora-is-near#125) * Add JSON custom error types. (aurora-is-near#131) * Don't burn NEP-141 on deposit. (aurora-is-near#133) * Fix needless borrows. (aurora-is-near#135) * Improve and refactor the ETH connector. (aurora-is-near#136) * Add a macro for logging. (aurora-is-near#142) Co-authored-by: Aleksey Kladov <[email protected]> Co-authored-by: Arto Bendiken <[email protected]> Co-authored-by: Evgeny Ukhanov <[email protected]> Co-authored-by: Frank Braun <[email protected]> Co-authored-by: Joshua J. Bouw <[email protected]> Co-authored-by: Kirill <[email protected]> Co-authored-by: Marcelo Fornet <[email protected]> Co-authored-by: Michael Birch <[email protected]>
- Loading branch information
1 parent
0e45d87
commit e8e68ac
Showing
59 changed files
with
12,224 additions
and
979 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"extends" : [ | ||
"standard", | ||
"plugin:promise/recommended" | ||
], | ||
"plugins": [ | ||
"promise" | ||
], | ||
"env": { | ||
"browser" : true, | ||
"node": true, | ||
"mocha": true, | ||
"jest": true | ||
}, | ||
"globals" : { | ||
"artifacts": false, | ||
"contract": false, | ||
"assert": false, | ||
"web3": false | ||
}, | ||
"rules": { | ||
|
||
// Strict mode | ||
"strict": [2, "global"], | ||
|
||
// Code style | ||
"indent": [2, 4], | ||
"quotes": [2, "single"], | ||
"semi": ["error", "always"], | ||
"space-before-function-paren": ["error", "always"], | ||
"no-use-before-define": 0, | ||
"no-unused-expressions": "off", | ||
"eqeqeq": [2, "smart"], | ||
"dot-notation": [2, {"allowKeywords": true, "allowPattern": ""}], | ||
"no-redeclare": [2, {"builtinGlobals": true}], | ||
"no-trailing-spaces": [2, { "skipBlankLines": true }], | ||
"eol-last": 1, | ||
"comma-spacing": [2, {"before": false, "after": true}], | ||
"camelcase": [2, {"properties": "always"}], | ||
"no-mixed-spaces-and-tabs": [2, "smart-tabs"], | ||
"comma-dangle": [1, "always-multiline"], | ||
"no-dupe-args": 2, | ||
"no-dupe-keys": 2, | ||
"no-debugger": 0, | ||
"no-undef": 2, | ||
"object-curly-spacing": [2, "always"], | ||
"max-len": [2, 200, 2], | ||
"generator-star-spacing": ["error", "before"], | ||
"promise/avoid-new": 0, | ||
"promise/always-return": 0 | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
|
||
# solium fails to run linter in Tester.sol | ||
# see issue for more details: https://github.com/duaraghav8/Ethlint/issues/293 | ||
contracts/test/Tester.sol | ||
|
||
# solium fails to run linter in Tester.sol | ||
# see issue for more details: https://github.com/duaraghav8/Ethlint/issues/294 | ||
contracts/test/StateTest.sol |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"extends": "solium:all", | ||
"plugins": ["security"], | ||
"rules": { | ||
"mixedcase": "off", | ||
"error-reason": "off", | ||
"indentation": ["error", 4], | ||
"lbrace": "off", | ||
"linebreak-style": ["error", "unix"], | ||
"max-len": ["error", 139], | ||
"no-constant": ["error"], | ||
"no-empty-blocks": "off", | ||
"quotes": ["error", "double"], | ||
"uppercase": "off", | ||
"visibility-first": "error", | ||
"arg-overflow": ["error", 5], | ||
"function-order": "off", | ||
|
||
"security/enforce-explicit-visibility": ["error"], | ||
"security/no-block-members": ["off"], | ||
"security/no-inline-assembly": ["warning"] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity ^0.8.0; | ||
|
||
|
||
contract AdminControlled { | ||
address public admin; | ||
uint public paused; | ||
|
||
constructor(address _admin, uint flags) { | ||
admin = _admin; | ||
|
||
// Add the possibility to set pause flags on the initialization | ||
paused = flags; | ||
} | ||
|
||
modifier onlyAdmin { | ||
require(msg.sender == admin); | ||
_; | ||
} | ||
|
||
modifier pausable(uint flag) { | ||
require((paused & flag) == 0 || msg.sender == admin); | ||
_; | ||
} | ||
|
||
function adminPause(uint flags) public onlyAdmin { | ||
paused = flags; | ||
} | ||
|
||
function adminSstore(uint key, uint value) public onlyAdmin { | ||
assembly { | ||
sstore(key, value) | ||
} | ||
} | ||
|
||
function adminSendEth(address payable destination, uint amount) public onlyAdmin { | ||
destination.transfer(amount); | ||
} | ||
|
||
function adminReceiveEth() public payable onlyAdmin {} | ||
|
||
function adminDelegatecall(address target, bytes memory data) public payable onlyAdmin returns (bytes memory) { | ||
(bool success, bytes memory rdata) = target.delegatecall(data); | ||
require(success); | ||
return rdata; | ||
} | ||
} |
Oops, something went wrong.