-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use locked pragma, security contact, cancun
- Loading branch information
Showing
21 changed files
with
62 additions
and
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
library Decimal { | ||
// unit is used for decimals, e.g. 0.123456 | ||
function unit() internal pure returns (uint256) { | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @title Initializable | ||
|
@@ -12,6 +12,8 @@ pragma solidity ^0.8.9; | |
* WARNING: When used with inheritance, manual care must be taken to not invoke | ||
* a parent initializer twice, or ensure that all initializers are idempotent, | ||
* because this is not dealt with automatically as with constructors. | ||
* | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract Initializable { | ||
/** | ||
|
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IEVMWriter { | ||
function setBalance(address acc, uint256 value) external; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface INodeDriver { | ||
function setGenesisValidator( | ||
address _auth, | ||
|
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface INodeDriverExecutable { | ||
function execute() external; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface ISFC { | ||
event CreatedValidator( | ||
uint256 indexed validatorID, | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Initializable} from "../common/Initializable.sol"; | ||
|
||
|
@@ -11,6 +11,8 @@ import {Initializable} from "../common/Initializable.sol"; | |
* This module is used through inheritance. It will make available the modifier | ||
* `onlyOwner`, which can be aplied to your functions to restrict their use to | ||
* the owner. | ||
* | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract Ownable is Initializable { | ||
address private _owner; | ||
|
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Ownable} from "../ownership/Ownable.sol"; | ||
import {Decimal} from "../common/Decimal.sol"; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract ConstantsManager is Ownable { | ||
// Minimum amount of stake for a validator, i.e., 500000 FTM | ||
uint256 public minSelfStake; | ||
|
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Decimal} from "../common/Decimal.sol"; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
library GP { | ||
function trimGasPriceChangeRatio(uint256 x) internal pure returns (uint256) { | ||
if (x > (Decimal.unit() * 105) / 100) { | ||
|
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract Migrations { | ||
address public owner; | ||
uint256 public lastCompletedMigration; | ||
|
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {ISFC} from "../interfaces/ISFC.sol"; | ||
import {NodeDriver, NodeDriverAuth} from "./NodeDriver.sol"; | ||
import {ConstantsManager} from "./ConstantsManager.sol"; | ||
import {Decimal} from "../common/Decimal.sol"; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract NetworkInitializer { | ||
// Initialize NodeDriverAuth, NodeDriver and SFC in one call to allow fewer genesis transactions | ||
function initializeAll( | ||
|
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Initializable} from "../common/Initializable.sol"; | ||
import {NodeDriverAuth} from "./NodeDriverAuth.sol"; | ||
import {IEVMWriter} from "../interfaces/IEVMWriter.sol"; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract NodeDriver is Initializable { | ||
NodeDriverAuth internal backend; | ||
IEVMWriter internal evmWriter; | ||
|
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Initializable} from "../common/Initializable.sol"; | ||
import {Ownable} from "../ownership/Ownable.sol"; | ||
import {ISFC} from "../interfaces/ISFC.sol"; | ||
import {NodeDriver} from "./NodeDriver.sol"; | ||
import {INodeDriverExecutable} from "../interfaces/INodeDriverExecutable.sol"; | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract NodeDriverAuth is Initializable, Ownable { | ||
ISFC internal sfc; | ||
NodeDriver internal driver; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Ownable} from "../ownership/Ownable.sol"; | ||
import {Initializable} from "../common/Initializable.sol"; | ||
|
@@ -11,6 +11,7 @@ import {Version} from "../version/Version.sol"; | |
|
||
/** | ||
* @dev SFC contract for Sonic network. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract SFC is Initializable, Ownable, Version { | ||
uint256 internal constant OK_STATUS = 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
pragma solidity 0.8.27; | ||
|
||
import {Ownable} from "../ownership/Ownable.sol"; | ||
import {Decimal} from "../common/Decimal.sol"; | ||
|
@@ -20,6 +20,9 @@ interface GovVersion { | |
function version() external pure returns (bytes4); | ||
} | ||
|
||
/** | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract Updater { | ||
address public sfcFrom; | ||
address public sfcConsts; | ||
|
This file was deleted.
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
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