Skip to content

Commit 8b9979c

Browse files
committed
added missing storage slot test, interface doc, updated solhint
1 parent 0e4c436 commit 8b9979c

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

packages/ethereum-contracts/.solhint.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
"constructor-syntax": "error",
1717
"func-visibility": ["error", { "ignoreConstructors": true }],
1818
"quotes": ["error", "double"],
19-
"max-line-length": ["error", 120]
19+
"max-line-length": ["error", 120],
20+
"use-natspec": "off",
21+
"import-path-check": "off",
22+
"gas-indexed-events": "off",
23+
"gas-struct-packing": "off",
24+
"gas-small-strings": "off",
25+
"gas-increment-by-one": "off",
26+
"gas-strict-inequalities": "off",
27+
"gas-calldata-parameters": "off",
28+
"function-max-lines": "off",
29+
"contract-name-capwords": "off"
2030
}
2131
}

packages/ethereum-contracts/contracts/agreements/AgreementLibrary.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ISuperApp,
88
SuperAppDefinitions
99
} from "../interfaces/superfluid/ISuperfluid.sol";
10-
import { ISuperfluidToken } from "../interfaces/superfluid/ISuperfluidToken.sol";
1110

1211
import { SafeCast } from "@openzeppelin-v5/contracts/utils/math/SafeCast.sol";
1312

packages/ethereum-contracts/contracts/interfaces/superfluid/ISuperToken.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,18 @@ interface ISuperToken is ISuperfluidToken, IERC20Metadata, IERC777, IERC20Permit
6868

6969
/**
7070
* @dev Returns the admin address for the SuperToken
71+
* The admin account has the exclusive privilege of
72+
* - updating the contract (change implementation)
73+
* - enabling/disabling a yield backend
74+
* - setting another admin
75+
* If no admin is set (zero address), this privileges are delegated to the host contract.
7176
*/
7277
function getAdmin() external view returns (address admin);
7378

79+
/**
80+
* @dev Returns the address of the yield backend contract (see `IYieldBackend`).
81+
* The yield backend contract is responsible for managing the yield of the SuperToken.
82+
*/
7483
function getYieldBackend() external view returns (address yieldBackend);
7584

7685
/**************************************************************************

packages/ethereum-contracts/contracts/libs/YieldBackendHelperLib.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { IYieldBackend } from "../interfaces/superfluid/IYieldBackend.sol";
1111
*/
1212
library YieldBackendHelperLib {
1313
function dCall(IYieldBackend yieldBackend, bytes memory callData) internal {
14+
// solhint-disable-next-line avoid-low-level-calls
1415
(bool success,) = address(yieldBackend).delegatecall(callData);
1516
require(success, "yield backend delegatecall failed");
1617
}

packages/ethereum-contracts/contracts/mocks/SuperTokenMock.t.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ contract SuperTokenStorageLayoutTester is SuperToken {
6464
require (slot == 18 && offset == 0, "_operators changed location");
6565
// uses 4 slots
6666

67+
assembly { slot:= _nonces.slot offset := _nonces.offset }
68+
require (slot == 22 && offset == 0, "_nonces changed location");
69+
70+
assembly { slot:= _yieldBackend.slot offset := _yieldBackend.offset }
71+
require (slot == 23 && offset == 0, "_yieldBackend changed location");
72+
6773
assembly { slot:= _reserve24.slot offset := _reserve24.offset }
6874
require (slot == 24 && offset == 0, "_reserve24 changed location");
6975

0 commit comments

Comments
 (0)