Skip to content

Commit 6dd0a34

Browse files
committed
Fix N-17
1 parent 891738b commit 6dd0a34

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

contracts/proxy/beacon/UpgradeableBeacon.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
5151
*/
5252
function upgradeTo(address newImplementation) public virtual onlyOwner {
5353
_setImplementation(newImplementation);
54-
emit Upgraded(newImplementation);
5554
}
5655

5756
/**
@@ -66,5 +65,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
6665
revert BeaconInvalidImplementation(newImplementation);
6766
}
6867
_implementation = newImplementation;
68+
emit Upgraded(newImplementation);
6969
}
7070
}

test/proxy/beacon/UpgradeableBeacon.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ contract('UpgradeableBeacon', function (accounts) {
2020
this.beacon = await UpgradeableBeacon.new(this.v1.address, owner);
2121
});
2222

23+
it('emits Upgraded event to the first implementation', async function () {
24+
const beacon = await UpgradeableBeacon.new(this.v1.address, owner);
25+
await expectEvent.inTransaction(beacon.contract.transactionHash, beacon, 'Upgraded', {
26+
implementation: this.v1.address,
27+
});
28+
});
29+
2330
it('returns implementation', async function () {
2431
expect(await this.beacon.implementation()).to.equal(this.v1.address);
2532
});

0 commit comments

Comments
 (0)