Skip to content

Commit

Permalink
more test around address being correct
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Sep 29, 2023
1 parent b55030e commit 2d423f5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
9 changes: 5 additions & 4 deletions src/delegation/ZoraCreator1155Attribution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ struct PremintConfig {
bool deleted;
}

/// @title Enables a creator to signal intent to create a Zora erc1155 contract or new token on that
/// @title Library for enables a creator to signal intent to create a Zora erc1155 contract or new token on that
/// contract by signing a transaction but not paying gas, and have a third party/collector pay the gas
/// by executing the transaction. Incentivizes the third party to execute the transaction by offering
/// a reward in the form of minted tokens.
/// by executing the transaction. Functions are exposed as external to allow contracts to import this lib and not increase their
/// size.
/// @author @oveddan
library ZoraCreator1155Attribution {
/* start eip712 functionality */
Expand Down Expand Up @@ -158,7 +158,8 @@ library ZoraCreator1155Attribution {
}
}

// todo: make it consistent.
/// @notice Utilitiy library to setup tokens created via premint. Functions exposed as external to not increase contract size in calling contract.
/// @author oveddan
library PremintTokenSetup {
uint256 constant PERMISSION_BIT_MINTER = 2 ** 2;

Expand Down
36 changes: 19 additions & 17 deletions src/deployment/DeterministicDeployerScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ contract DeterministicDeployerScript is Script {

DeterministicProxyDeployer factoryDeployer = getOrCreateProxyDeployer();

return
factoryDeployer.createFactoryProxyDeterministic(
params.proxyShimSalt,
params.proxySalt,
params.proxyCreationCode,
params.deterministicProxyAddress,
implementation,
owner,
signature
);
address resultAddress = factoryDeployer.createFactoryProxyDeterministic(
params.proxyShimSalt,
params.proxySalt,
params.proxyCreationCode,
params.deterministicProxyAddress,
implementation,
owner,
signature
);

require(resultAddress == params.deterministicProxyAddress, "DeterministicDeployerScript: proxy address mismatch");
}

function deployUpgradeGate(uint256 chain, address upgradeGateOwner) internal returns (address) {
Expand All @@ -228,12 +229,13 @@ contract DeterministicDeployerScript is Script {

DeterministicProxyDeployer factoryDeployer = getOrCreateProxyDeployer();

return
factoryDeployer.createAndInitGenericContractDeterministic({
genericCreationSalt: genericCreationSalt,
creationCode: creationCode,
initCall: abi.encodeWithSelector(UpgradeGate.initialize.selector, upgradeGateOwner),
signature: signature
});
address resultAddress = factoryDeployer.createAndInitGenericContractDeterministic({
genericCreationSalt: genericCreationSalt,
creationCode: creationCode,
initCall: abi.encodeWithSelector(UpgradeGate.initialize.selector, upgradeGateOwner),
signature: signature
});

require(resultAddress == vm.parseJsonAddress(upgradeGateParams, ".upgradeGateAddress"), "DeterministicDeployerScript: upgrade gate address mismatch");
}
}

0 comments on commit 2d423f5

Please sign in to comment.