Skip to content

Commit b9a69f1

Browse files
fix typo - remove one state variable
1 parent 2be8cff commit b9a69f1

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

contracts/ByocFactory.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ contract ByocFactory is IByocFactory, ERC2771Context, AccessControlEnumerable {
5858
uint256 _value,
5959
string memory publishMetadataUri
6060
) external onlyUnpausedOrAdmin returns (address deployedAddress) {
61-
6261
deployer = _msgSender();
6362

6463
require(bytes(publishMetadataUri).length > 0, "No publish metadata");
@@ -68,7 +67,7 @@ contract ByocFactory is IByocFactory, ERC2771Context, AccessControlEnumerable {
6867

6968
deployedAddress = Create2.deploy(_value, salt, contractBytecode);
7069

71-
ThirdwebContract(deployedAddress).setPublisheMetadataUi(publishMetadataUri);
70+
ThirdwebContract(deployedAddress).setPublishMetadataUri(publishMetadataUri);
7271
require(
7372
keccak256(bytes(ThirdwebContract(deployedAddress).getPublishMetadataUri())) ==
7473
keccak256(bytes(publishMetadataUri)),
@@ -94,7 +93,7 @@ contract ByocFactory is IByocFactory, ERC2771Context, AccessControlEnumerable {
9493
bytes32 salt = _salt == "" ? keccak256(abi.encodePacked(_msgSender(), block.number)) : _salt;
9594
deployedAddress = Clones.cloneDeterministic(_implementation, salt);
9695

97-
ThirdwebContract(deployedAddress).setPublisheMetadataUi(publishMetadataUri);
96+
ThirdwebContract(deployedAddress).setPublishMetadataUri(publishMetadataUri);
9897
require(
9998
keccak256(bytes(ThirdwebContract(deployedAddress).getPublishMetadataUri())) ==
10099
keccak256(bytes(publishMetadataUri)),

contracts/ThirdwebContract.sol

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ interface IDeployer {
88
contract ThirdwebContract {
99
/// @dev The publish metadata of the contract of which this contract is an instance.
1010
string private publishMetadataUri;
11-
12-
/// @dev The address of the thirdweb factory.
13-
address private factory;
14-
1511
/// @dev Address of the contract deployer.
1612
address private deployer;
1713

1814
constructor() {
19-
factory = msg.sender;
2015
deployer = IDeployer(msg.sender).deployer();
2116
}
2217

@@ -26,17 +21,13 @@ contract ThirdwebContract {
2621
}
2722

2823
/// @dev Initializes the publish metadata and at deploy time.
29-
function setPublisheMetadataUi(string memory uri) external {
24+
function setPublishMetadataUri(string memory uri) external {
3025
require(bytes(publishMetadataUri).length == 0, "Published metadata already initialized");
3126
publishMetadataUri = uri;
3227
}
3328

3429
/// @dev Returns msg.sender, if caller is not thirdweb factory. Returns the intended msg.sender if caller is factory.
35-
function _thirdwebMsgSender() internal view returns (address sender) {
36-
if (msg.sender == factory) {
37-
sender = deployer;
38-
} else {
39-
sender = msg.sender;
40-
}
30+
function _contractDeployer() internal view returns (address) {
31+
return deployer;
4132
}
4233
}

docs/ThirdwebContract.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function getPublishMetadataUri() external view returns (string)
2727
|---|---|---|
2828
| _0 | string | undefined
2929

30-
### setPublisheMetadataUi
30+
### setPublishMetadataUri
3131

3232
```solidity
33-
function setPublisheMetadataUi(string uri) external nonpayable
33+
function setPublishMetadataUri(string uri) external nonpayable
3434
```
3535

3636

0 commit comments

Comments
 (0)