Skip to content

Commit 95e78b6

Browse files
committed
Remove Safe checks
1 parent 2223ef7 commit 95e78b6

7 files changed

Lines changed: 6 additions & 55 deletions

File tree

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44
[submodule "lib/fvm-solidity"]
55
path = lib/fvm-solidity
66
url = https://github.com/filecoin-project/fvm-solidity
7-
[submodule "lib/safe-smart-account"]
8-
path = lib/safe-smart-account
9-
url = https://github.com/safe-fndn/safe-smart-account

foundry.lock

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,5 @@
77
},
88
"lib/fvm-solidity": {
99
"rev": "ea1fe65367d7539236be111916a6e2781bcf7a1b"
10-
},
11-
"lib/safe-smart-account": {
12-
"tag": {
13-
"name": "v1.5.0",
14-
"rev": "77901a5a1ad835b74ad3b72f73a8412cfe491c57"
15-
}
1610
}
1711
}

foundry.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ bytecode_hash = "none"
1515
remappings = [
1616
'forge-std/=lib/forge-std/src/',
1717
'fvm-solidity/=lib/fvm-solidity/src/',
18-
'@safe/=lib/safe-smart-account/contracts/',
1918
]
2019

2120
[lint]

lib/safe-smart-account

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/StreamWeightActor.sol

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {FVMRewards} from "./lib/FVMRewards.sol";
99
import {PendingOp, Share, WeightRecord, WeightRecordUpdate} from "./lib/FVMRewardTypes.sol";
1010
import {OwnersLibrary} from "./lib/Owners.sol";
1111
import {UnanimousGovernance} from "./lib/UnanimousGovernance.sol";
12-
import {IsASafe} from "./lib/IsASafe.sol";
1312

1413
uint64 constant SERVICE_ID = 2;
1514

@@ -20,21 +19,17 @@ int256 constant STEP = 5e16; // 5%
2019
/// @dev Writes require unanimous owner approval, except `cancelPending`/`cancelPendingWeight`
2120
/// (any single owner, immediate) and `quarterlyGateCheck` (fully permissionless).
2221
contract StreamWeightActor is UnanimousGovernance {
23-
using IsASafe for address;
2422
using OwnersLibrary for address;
2523

2624
IServiceRewardsActor immutable SRA;
2725
Epoch immutable QUARTER;
2826
Epoch immutable HOLD;
2927

3028
/// @notice Deploys the actor with its two initial owners, bound to a Service Rewards Actor.
31-
/// @param owner1 First owner; must be a Safe.
32-
/// @param owner2 Second owner; must be a Safe.
29+
/// @param owner1 First owner.
30+
/// @param owner2 Second owner.
3331
/// @param sra Service Rewards Actor supplying QUARTER/HOLD and gating `quarterlyGateCheck`.
3432
constructor(address owner1, address owner2, IServiceRewardsActor sra) {
35-
owner1.isProbablyASafe();
36-
owner2.isProbablyASafe();
37-
3833
owner1.addOwner();
3934
owner2.addOwner();
4035

@@ -118,9 +113,8 @@ contract StreamWeightActor is UnanimousGovernance {
118113

119114
/// @notice Replaces one of the two owners.
120115
/// @param prevOwner Owner being removed.
121-
/// @param newOwner Owner being added; must be a Safe.
116+
/// @param newOwner Owner being added.
122117
function replaceOwner(address prevOwner, address newOwner) external unanimousNoHold(keccak256(msg.data)) {
123-
newOwner.isProbablyASafe();
124118
prevOwner.removeOwner();
125119
newOwner.addOwner();
126120
}

src/lib/IsASafe.sol

Lines changed: 0 additions & 18 deletions
This file was deleted.

test/StreamWeightActor.t.sol

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0 OR MIT
22
pragma solidity ^0.8.36;
33

4-
import {SafeProxy} from "@safe/proxies/SafeProxy.sol";
5-
64
import {USR_FORBIDDEN, USR_ILLEGAL_ARGUMENT, USR_NOT_FOUND} from "fvm-solidity/FVMErrors.sol";
75

86
import {MockRewardTest} from "./mocks/MockRewardTest.sol";
@@ -27,8 +25,8 @@ contract StreamWeightActorTest is MockRewardTest {
2725

2826
function setUp() public override {
2927
super.setUp();
30-
owner1 = _makeSafeOwner("owner1");
31-
owner2 = _makeSafeOwner("owner2");
28+
owner1 = makeAddr("owner1");
29+
owner2 = makeAddr("owner2");
3230

3331
address sra = makeAddr("sra");
3432
vm.mockCall(
@@ -40,18 +38,6 @@ contract StreamWeightActorTest is MockRewardTest {
4038
rewardActor().mockSwa(address(actor));
4139
}
4240

43-
function _makeSafeOwner(string memory label) internal returns (address proxyAddr) {
44-
address masterCopy = makeAddr(string.concat(label, "-mastercopy"));
45-
vm.etch(masterCopy, new bytes(8001));
46-
47-
SafeProxy real = new SafeProxy(masterCopy);
48-
bytes memory code = address(real).code;
49-
50-
proxyAddr = makeAddr(label);
51-
vm.etch(proxyAddr, code);
52-
vm.store(proxyAddr, bytes32(0), bytes32(uint256(uint160(masterCopy))));
53-
}
54-
5541
// -------------------------------------------------------------------------
5642
// Helpers
5743
// -------------------------------------------------------------------------
@@ -285,7 +271,7 @@ contract StreamWeightActorTest is MockRewardTest {
285271
// -------------------------------------------------------------------------
286272

287273
function test_ReplaceOwner_Success_SwapsApprovalRights() public {
288-
address newOwner = _makeSafeOwner("newOwner");
274+
address newOwner = makeAddr("newOwner");
289275

290276
vm.prank(owner1);
291277
actor.replaceOwner(owner2, newOwner);

0 commit comments

Comments
 (0)