Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix N-17
  • Loading branch information
ernestognw committed Aug 3, 2023
commit 687b80515b16138d11e79eb2d9503fb1ae8defec
2 changes: 1 addition & 1 deletion contracts/proxy/beacon/UpgradeableBeacon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
*/
function upgradeTo(address newImplementation) public virtual onlyOwner {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}

/**
Expand All @@ -66,5 +65,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
revert BeaconInvalidImplementation(newImplementation);
}
_implementation = newImplementation;
emit Upgraded(newImplementation);
}
}
7 changes: 7 additions & 0 deletions test/proxy/beacon/UpgradeableBeacon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ contract('UpgradeableBeacon', function (accounts) {
this.beacon = await UpgradeableBeacon.new(this.v1.address, owner);
});

it('emits Upgraded event to the first implementation', async function () {
const beacon = await UpgradeableBeacon.new(this.v1.address, owner);
await expectEvent.inTransaction(beacon.contract.transactionHash, beacon, 'Upgraded', {
implementation: this.v1.address,
});
});

it('returns implementation', async function () {
expect(await this.beacon.implementation()).to.equal(this.v1.address);
});
Expand Down