Skip to content

Commit 88273b6

Browse files
authored
Aljanah release v2.100 to mainnet (Synthetixio#2216)
1 parent b2aacd4 commit 88273b6

40 files changed

+2257
-1095
lines changed

.circleci/config.template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DO NOT EDIT MANUALLY! instead run `npm run build:ci`
22
# autogenerated by `.circleci/pack.js` from contents of `jobs` .yml files
33
version: 2.1
4-
orbs:
4+
orbs:
55
rust: circleci/rust@1.6.0
66
commands:
77
{{> commands}}

.circleci/config.yml

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DO NOT EDIT MANUALLY! instead run `npm run build:ci`
22
# autogenerated by `.circleci/pack.js` from contents of `jobs` .yml files
33
version: 2.1
4-
orbs:
4+
orbs:
55
rust: circleci/rust@1.6.0
66
commands:
77
cmd-wait-for-port:
@@ -18,7 +18,7 @@ jobs:
1818
job-audit:
1919
working_directory: ~/repo
2020
docker:
21-
- image: synthetixio/docker-sec-tools:16.17-ubuntu
21+
- image: synthetixio/docker-sec-tools:18.19-ubuntu
2222
steps:
2323
- checkout
2424
- run:
@@ -32,7 +32,7 @@ jobs:
3232
job-cannon:
3333
working_directory: ~/repo
3434
machine:
35-
image: ubuntu-2204:2022.04.1
35+
image: ubuntu-2204:current
3636
docker_layer_caching: true
3737
environment:
3838
foundry_cache_version: "1"
@@ -92,10 +92,11 @@ jobs:
9292
- build
9393
- cannon
9494
- publish/deployed
95+
resource_class: large
9596
job-fork-tests-ovm:
9697
working_directory: ~/repo
9798
docker:
98-
- image: synthetixio/docker-node:16.17-ubuntu
99+
- image: synthetixio/docker-node:18.19-ubuntu
99100
resource_class: large
100101
steps:
101102
- checkout
@@ -122,7 +123,7 @@ jobs:
122123
job-fork-tests:
123124
working_directory: ~/repo
124125
docker:
125-
- image: synthetixio/docker-node:16.17-ubuntu
126+
- image: synthetixio/docker-node:18.19-ubuntu
126127
resource_class: large
127128
steps:
128129
- checkout
@@ -149,7 +150,7 @@ jobs:
149150
job-integration-tests:
150151
working_directory: ~/repo
151152
machine:
152-
image: ubuntu-2204:2022.04.1
153+
image: ubuntu-2204:current
153154
docker_layer_caching: true
154155
environment:
155156
foundry_cache_version: "1"
@@ -247,7 +248,7 @@ jobs:
247248
job-lint:
248249
working_directory: ~/repo
249250
docker:
250-
- image: synthetixio/docker-node:16.17-ubuntu
251+
- image: synthetixio/docker-node:18.19-ubuntu
251252
steps:
252253
- checkout
253254
- attach_workspace:
@@ -256,7 +257,7 @@ jobs:
256257
job-pack-browser:
257258
working_directory: ~/repo
258259
docker:
259-
- image: synthetixio/docker-node:16.17-ubuntu
260+
- image: synthetixio/docker-node:18.19-ubuntu
260261
steps:
261262
- checkout
262263
- attach_workspace:
@@ -267,7 +268,7 @@ jobs:
267268
job-prepare:
268269
working_directory: ~/repo
269270
docker:
270-
- image: synthetixio/docker-node:16.17-ubuntu
271+
- image: synthetixio/docker-node:18.19-ubuntu
271272
steps:
272273
- run:
273274
name: Set node & npm versions
@@ -298,7 +299,7 @@ jobs:
298299
job-simulate-release:
299300
working_directory: ~/repo
300301
docker:
301-
- image: synthetixio/docker-node:16.17-ubuntu
302+
- image: synthetixio/docker-node:18.19-ubuntu
302303
steps:
303304
- checkout
304305
- attach_workspace:
@@ -322,7 +323,7 @@ jobs:
322323
job-static-analysis:
323324
working_directory: ~/repo
324325
docker:
325-
- image: synthetixio/docker-node:16.17-ubuntu
326+
- image: synthetixio/docker-node:18.19-ubuntu
326327
steps:
327328
- checkout
328329
- attach_workspace:
@@ -339,7 +340,7 @@ jobs:
339340
job-test-deploy-script:
340341
working_directory: ~/repo
341342
machine:
342-
image: ubuntu-2204:2022.04.1
343+
image: ubuntu-2204:current
343344
docker_layer_caching: true
344345
environment:
345346
foundry_cache_version: "1"
@@ -392,7 +393,7 @@ jobs:
392393
job-unit-tests-coverage-report:
393394
working_directory: ~/repo
394395
docker:
395-
- image: synthetixio/docker-sec-tools:16.17-ubuntu
396+
- image: synthetixio/docker-sec-tools:18.19-ubuntu
396397
steps:
397398
- checkout
398399
- attach_workspace:
@@ -405,7 +406,7 @@ jobs:
405406
job-unit-tests-coverage:
406407
working_directory: ~/repo
407408
docker:
408-
- image: synthetixio/docker-node:16.17-ubuntu
409+
- image: synthetixio/docker-node:18.19-ubuntu
409410
resource_class: large
410411
parallelism: 8
411412
steps:
@@ -432,7 +433,7 @@ jobs:
432433
job-unit-tests-gas-report:
433434
working_directory: ~/repo
434435
docker:
435-
- image: synthetixio/docker-node:16.17-ubuntu
436+
- image: synthetixio/docker-node:18.19-ubuntu
436437
steps:
437438
- checkout
438439
- attach_workspace:
@@ -450,7 +451,7 @@ jobs:
450451
job-unit-tests:
451452
working_directory: ~/repo
452453
docker:
453-
- image: synthetixio/docker-node:16.17-ubuntu
454+
- image: synthetixio/docker-node:18.19-ubuntu
454455
resource_class: large
455456
parallelism: 8
456457
steps:
@@ -483,7 +484,7 @@ jobs:
483484
job-validate-deployments:
484485
working_directory: ~/repo
485486
docker:
486-
- image: synthetixio/docker-node:16.17-ubuntu
487+
- image: synthetixio/docker-node:18.19-ubuntu
487488
steps:
488489
- checkout
489490
- attach_workspace:
@@ -499,7 +500,7 @@ jobs:
499500
job-validate-etherscan:
500501
working_directory: ~/repo
501502
docker:
502-
- image: synthetixio/docker-node:16.17-ubuntu
503+
- image: synthetixio/docker-node:18.19-ubuntu
503504
parameters:
504505
network:
505506
type: string

.circleci/src/jobs/job-cannon.yml

+2
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ steps:
6060
- build
6161
- cannon
6262
- publish/deployed
63+
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
64+
resource_class: large
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
working_directory: ~/repo
22
machine:
3-
image: ubuntu-2204:2022.04.1
3+
image: ubuntu-2204:current
44
docker_layer_caching: true
55
environment:
66
foundry_cache_version: "1"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
working_directory: ~/repo
22
docker:
3-
- image: synthetixio/docker-node:16.17-ubuntu
3+
- image: synthetixio/docker-node:18.19-ubuntu
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
working_directory: ~/repo
22
docker:
3-
- image: synthetixio/docker-sec-tools:16.17-ubuntu
3+
- image: synthetixio/docker-sec-tools:18.19-ubuntu

.github/workflows/slither-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
container:
17-
image: synthetixio/docker-sec-tools:16.17-ubuntu
17+
image: synthetixio/docker-sec-tools:18.19-ubuntu
1818

1919
steps:
2020
- name: Checkout

contracts/BaseRewardEscrowV2.sol

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ contract BaseRewardEscrowV2 is Owned, IRewardEscrowV2, LimitedSetup(8 weeks), Mi
2424

2525
/* Mapping of nominated address to recieve account merging */
2626
mapping(address => address) public nominatedReceiver;
27+
mapping(address => bool) public permittedEscrowCreators;
2728

2829
/* Max escrow duration */
2930
uint public max_duration = 2 * 52 weeks; // Default max 2 years duration
@@ -307,6 +308,10 @@ contract BaseRewardEscrowV2 is Owned, IRewardEscrowV2, LimitedSetup(8 weeks), Mi
307308
synthetixERC20().transfer(transferTo, amount);
308309
}
309310

311+
function setPermittedEscrowCreator(address creator, bool permitted) external onlyOwner {
312+
permittedEscrowCreators[creator] = permitted;
313+
}
314+
310315
/**
311316
* @notice Create an escrow entry to lock SNX for a given duration in seconds
312317
* @dev This call expects that the depositor (msg.sender) has already approved the Reward escrow contract
@@ -318,6 +323,7 @@ contract BaseRewardEscrowV2 is Owned, IRewardEscrowV2, LimitedSetup(8 weeks), Mi
318323
uint256 duration
319324
) external {
320325
require(beneficiary != address(0), "Cannot create escrow with address(0)");
326+
require(permittedEscrowCreators[msg.sender], "Only permitted escrow creators can create escrow entries");
321327

322328
/* Transfer SNX from msg.sender */
323329
require(synthetixERC20().transferFrom(msg.sender, address(this), deposit), "token transfer failed");

contracts/BaseSynthetix.sol

+6-12
Original file line numberDiff line numberDiff line change
@@ -449,34 +449,28 @@ contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix {
449449
return success;
450450
}
451451

452-
/**
453-
* @notice allows for migration from v2x to v3 when an account has pending escrow entries
454-
*/
455-
function revokeAllEscrow(address account) external systemActive {
456-
address legacyMarketAddress = resolver.getAddress(CONTRACT_V3_LEGACYMARKET);
457-
require(msg.sender == legacyMarketAddress, "Only LegacyMarket can revoke escrow");
458-
rewardEscrowV2().revokeFrom(account, legacyMarketAddress, rewardEscrowV2().totalEscrowedAccountBalance(account), 0);
459-
}
460-
461452
function migrateAccountBalances(address account)
462453
external
463454
systemActive
464455
returns (uint totalEscrowRevoked, uint totalLiquidBalance)
465456
{
466457
address debtMigratorOnEthereum = resolver.getAddress(CONTRACT_DEBT_MIGRATOR_ON_ETHEREUM);
467-
require(msg.sender == debtMigratorOnEthereum, "Only L1 DebtMigrator");
458+
require(
459+
msg.sender == debtMigratorOnEthereum || msg.sender == resolver.getAddress(CONTRACT_V3_LEGACYMARKET),
460+
"Only L1 DebtMigrator or LegacyMarket"
461+
);
468462

469463
// get their liquid SNX balance and transfer it to the migrator contract
470464
totalLiquidBalance = tokenState.balanceOf(account);
471465
if (totalLiquidBalance > 0) {
472-
bool succeeded = _transferByProxy(account, debtMigratorOnEthereum, totalLiquidBalance);
466+
bool succeeded = _transferByProxy(account, msg.sender, totalLiquidBalance);
473467
require(succeeded, "snx transfer failed");
474468
}
475469

476470
// get their escrowed SNX balance and revoke it all
477471
totalEscrowRevoked = rewardEscrowV2().totalEscrowedAccountBalance(account);
478472
if (totalEscrowRevoked > 0) {
479-
rewardEscrowV2().revokeFrom(account, debtMigratorOnEthereum, totalEscrowRevoked, 0);
473+
rewardEscrowV2().revokeFrom(account, msg.sender, totalEscrowRevoked, 0);
480474
}
481475
}
482476

contracts/interfaces/ISynthetix.sol

-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,5 @@ interface ISynthetix {
140140

141141
function burnSecondary(address account, uint amount) external;
142142

143-
function revokeAllEscrow(address account) external;
144-
145143
function migrateAccountBalances(address account) external returns (uint totalEscrowRevoked, uint totalLiquidBalance);
146144
}

0 commit comments

Comments
 (0)