Skip to content

Commit 9c3f84d

Browse files
nkrishangKrishang Nadgauda
and
Krishang Nadgauda
authored
Audit fixes: ContractPublisher.sol (#214)
* forge update * Fix Q-2 Missing Events: setPublisherProfileUri does not emit an event Co-authored-by: Krishang Nadgauda <[email protected]>
1 parent 7e9fb99 commit 9c3f84d

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

contracts/ContractPublisher.sol

+3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ contract ContractPublisher is IContractPublisher, ERC2771Context, AccessControlE
177177

178178
/// @notice Lets an account set its own publisher profile uri
179179
function setPublisherProfileUri(address publisher, string memory uri) public onlyPublisher(publisher) {
180+
string memory currentURI = profileUriOfPublisher[publisher];
180181
profileUriOfPublisher[publisher] = uri;
182+
183+
emit PublisherProfileUpdated(publisher, currentURI, uri);
181184
}
182185

183186
// @notice Get a publisher profile uri

contracts/interfaces/IContractPublisher.sol

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ interface IContractPublisher {
4141
/// @dev Emitted when a contract is unpublished.
4242
event ContractUnpublished(address indexed operator, address indexed publisher, string indexed contractId);
4343

44+
/// @dev Emitted when a publisher updates their profile URI.
45+
event PublisherProfileUpdated(address indexed publisher, string prevURI, string newURI);
46+
4447
/**
4548
* @notice Returns the latest version of all contracts published by a publisher.
4649
*

docs/ContractPublisher.md

+18
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,24 @@ event Paused(bool isPaused)
507507
|---|---|---|
508508
| isPaused | bool | undefined |
509509

510+
### PublisherProfileUpdated
511+
512+
```solidity
513+
event PublisherProfileUpdated(address indexed publisher, string prevURI, string newURI)
514+
```
515+
516+
517+
518+
519+
520+
#### Parameters
521+
522+
| Name | Type | Description |
523+
|---|---|---|
524+
| publisher `indexed` | address | undefined |
525+
| prevURI | string | undefined |
526+
| newURI | string | undefined |
527+
510528
### RoleAdminChanged
511529

512530
```solidity

docs/IContractPublisher.md

+18
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,23 @@ event Paused(bool isPaused)
233233
|---|---|---|
234234
| isPaused | bool | undefined |
235235

236+
### PublisherProfileUpdated
237+
238+
```solidity
239+
event PublisherProfileUpdated(address indexed publisher, string prevURI, string newURI)
240+
```
241+
242+
243+
244+
*Emitted when a publisher updates their profile URI.*
245+
246+
#### Parameters
247+
248+
| Name | Type | Description |
249+
|---|---|---|
250+
| publisher `indexed` | address | undefined |
251+
| prevURI | string | undefined |
252+
| newURI | string | undefined |
253+
236254

237255

0 commit comments

Comments
 (0)