Skip to content

Commit 9a9cde6

Browse files
authored
feat: upgradable treasury (#42)
upgradeable task treasury
1 parent ede0c04 commit 9a9cde6

124 files changed

Lines changed: 25146 additions & 1885 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ typechain
2121
# yarn
2222
yarn-error.log
2323
package-lock.json
24+
25+
dist

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ artifacts
33
cache
44
dist
55
coverage
6-
contracts/vendor
76
typechain
87
yarn.lock
98
yarn-error.log

.prettierrc.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
{
44
"files": "*.sol",
55
"options": {
6-
"compiler": "0.8.0"
7-
}
8-
},
9-
{
10-
"files": "contracts/dependencies/GelatoCoreImport.sol",
11-
"options": {
12-
"compiler": "0.6.10"
6+
"compiler": "0.8.12"
137
}
148
}
159
]

.solhint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"code-complexity": ["error", 5],
77
"function-max-lines": ["error", 40],
88
"max-line-length": ["error", 100],
9-
"max-states-count": ["error", 3],
9+
"max-states-count": ["warn", 3],
1010
"no-empty-blocks": "error",
1111
"no-unused-vars": "error",
1212
"payable-fallback": "off",
@@ -32,7 +32,7 @@
3232
"avoid-throw": "error",
3333
"avoid-tx-origin": "off",
3434
"check-send-result": "error",
35-
"compiler-version": ["error", "0.8.0"],
35+
"compiler-version": ["error", "^0.8.0"],
3636
"mark-callable-contracts": "off",
3737
"func-visibility": ["error", { "ignoreConstructors": true }],
3838
"multiple-sends": "error",

.solhintignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
node_modules/
2-
contracts/dependencies
3-
contracts/diamond/facets/standard
4-
contracts/diamond/interfaces/standard
5-
contracts/diamond/libraries/standard
6-
contracts/functions
7-
contracts/vendor
8-
contracts/diamond/__mocks__/MockUniV3Oracle/libraries
2+
contracts/interfaces
3+
contracts/vendor

contracts/Forwarder.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity 0.8.0;
2+
pragma solidity ^0.8.0;
33

44
contract Forwarder {
55
function checker(bytes memory execData)

contracts/Ops.sol

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity 0.8.0;
2+
pragma solidity 0.8.12;
33

4-
import {Gelatofied} from "./gelato/Gelatofied.sol";
5-
import {GelatoBytes} from "./gelato/GelatoBytes.sol";
4+
import {Gelatofied} from "./vendor/gelato/Gelatofied.sol";
5+
import {GelatoBytes} from "./vendor/gelato/GelatoBytes.sol";
66
import {
77
EnumerableSet
88
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
99
import {
1010
SafeERC20,
1111
IERC20
1212
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
13-
import {TaskTreasury} from "./taskTreasury/TaskTreasury.sol";
13+
import {
14+
ITaskTreasuryUpgradable
15+
} from "./interfaces/ITaskTreasuryUpgradable.sol";
1416

1517
// solhint-disable max-line-length
1618
// solhint-disable max-states-count
@@ -34,7 +36,7 @@ contract Ops is Gelatofied {
3436
mapping(bytes32 => address) public taskCreator;
3537
mapping(bytes32 => address) public execAddresses;
3638
mapping(address => EnumerableSet.Bytes32Set) internal _createdTasks;
37-
address public immutable taskTreasury;
39+
ITaskTreasuryUpgradable public immutable taskTreasury;
3840
uint256 public fee;
3941
address public feeToken;
4042
// Appended State
@@ -66,7 +68,7 @@ contract Ops is Gelatofied {
6668
uint128 indexed interval
6769
);
6870

69-
constructor(address payable _gelato, address _taskTreasury)
71+
constructor(address payable _gelato, ITaskTreasuryUpgradable _taskTreasury)
7072
Gelatofied(_gelato)
7173
{
7274
taskTreasury = _taskTreasury;
@@ -117,11 +119,7 @@ contract Ops is Gelatofied {
117119
returnData.revertWithError("Ops.exec:");
118120

119121
if (_useTaskTreasuryFunds) {
120-
TaskTreasury(taskTreasury).useFunds(
121-
_feeToken,
122-
_txFee,
123-
_taskCreator
124-
);
122+
taskTreasury.useFunds(_taskCreator, _feeToken, _txFee);
125123
} else {
126124
delete fee;
127125
delete feeToken;

contracts/TaskTreasury/TaskTreasury.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity 0.8.0;
2+
pragma solidity ^0.8.0;
33

44
import {
55
EnumerableSet
@@ -13,7 +13,7 @@ import {
1313
ReentrancyGuard
1414
} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
1515
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
16-
import {_transfer, ETH} from "../gelato/FGelato.sol";
16+
import {_transfer, ETH} from "../vendor/gelato/FGelato.sol";
1717

1818
contract TaskTreasury is Ownable, ReentrancyGuard {
1919
using EnumerableSet for EnumerableSet.AddressSet;

contracts/TaskTreasury/TaskTreasuryL2.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity 0.8.0;
2+
pragma solidity ^0.8.0;
33

44
import {
55
EnumerableSet
@@ -13,7 +13,7 @@ import {
1313
ReentrancyGuard
1414
} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
1515
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
16-
import {_transfer, ETH} from "../gelato/FGelato.sol";
16+
import {_transfer, ETH} from "../vendor/gelato/FGelato.sol";
1717

1818
// solhint-disable max-states-count
1919
// solhint-disable max-line-length

0 commit comments

Comments
 (0)