Address Contract Verified
Address
0x1F65B83F36c1474D571E0d89136bb7704eE5F46D
Balance
0 ETH
Nonce
1
Code Size
4901 bytes
Creator
0x30605010...A4b8 at tx 0xcd79e217...c0cf83
Indexed Transactions
0
Contract Bytecode
4901 bytes
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638f32d59b116100a2578063d539139311610071578063d539139314610233578063e47957d314610248578063ed459df21461025b578063f2fde38b1461026e578063fca3b5aa1461028157600080fd5b80638f32d59b146101e6578063a217fddf14610205578063b898b4b11461020d578063c474dd0e1461022057600080fd5b80635414dff0116100e95780635414dff01461019d57806367f1a2f1146101b0578063715018a6146101c357806379ba5097146101cb5780638da5cb5b146101d357600080fd5b8063075461721461011b578063206b60f91461014b57806323452b9c14610180578063382d9cc41461018a575b600080fd5b60045461012e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101727f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c81565b604051908152602001610142565b610188610294565b005b60035461012e906001600160a01b031681565b61012e6101ab366004610d64565b6102d9565b61012e6101be366004610f23565b610398565b61018861051f565b610188610553565b60005461012e906001600160a01b031681565b6000546001600160a01b031633145b6040519015158152602001610142565b610172600081565b61018861021b366004611098565b61060a565b61018861022e366004611098565b610640565b6101726000805160206112d083398151915281565b60025461012e906001600160a01b031681565b6001546001600160a01b031633146101f5565b61018861027c366004611098565b610673565b61018861028f366004611098565b610715565b6000546001600160a01b031633146102c75760405162461bcd60e51b81526004016102be906110b5565b60405180910390fd5b600180546001600160a01b0319169055565b6003546040516bffffffffffffffffffffffff193060601b16602082015260348101839052600091610392916001600160a01b039091169060540160408051808303601f190181529082905280516020909101206002546001600160a01b031660388301526f5af43d82803e903d91602b57fd5bf3ff60248301526014820192909252733d602d80600a3d3981f3363d3d373d3d3d363d73815260588101919091526037600c8201206078820152605560439091012090565b92915050565b60008063e159163460e01b308460200151856040015186606001518760a001518860c001518960e001518a610100015160008c61014001516040516024016103e99a99989796959493929190611132565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050600061042f82856101600151610748565b84516080860151604051631607e8a560e31b81529293506001600160a01b0384169263b03f45289261046d929091600019919060009060040161121e565b600060405180830381600087803b15801561048757600080fd5b505af115801561049b573d6000803e3d6000fd5b505050506104b4818561014001518661012001516107ce565b6104c2818560000151610894565b83600001516001600160a01b0316816001600160a01b03167fd283ed05905c0eb69fe3ef042c6ad706d8d9c75b138624098de540fa2c011a0586610160015160405161051091815260200190565b60405180910390a39392505050565b6000546001600160a01b031633146105495760405162461bcd60e51b81526004016102be906110b5565b610551610c06565b565b6001546001600160a01b031633146105c25760405162461bcd60e51b815260206004820152602c60248201527f63757272656e74206f776e6572206d757374207365742063616c6c657220617360448201526b103732bc3a1037bbb732b91760a11b60648201526084016102be565b600180546001600160a01b0319908116909155600080543392168217815560405182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3565b6000546001600160a01b031633146106345760405162461bcd60e51b81526004016102be906110b5565b61063d81610c50565b50565b6000546001600160a01b0316331461066a5760405162461bcd60e51b81526004016102be906110b5565b61063d81610cac565b6000546001600160a01b0316331461069d5760405162461bcd60e51b81526004016102be906110b5565b6001600160a01b0381166106f35760405162461bcd60e51b815260206004820152601f60248201527f4e657874206f776e657220697320746865207a65726f20616464726573732e0060448201526064016102be565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461073f5760405162461bcd60e51b81526004016102be906110b5565b61063d81610d08565b6002546003546040516311b804ab60e01b81526000926001600160a01b03908116926311b804ab92610784929091169087908790600401611256565b6020604051808303816000875af11580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c7919061128a565b9392505050565b604051631f95148f60e21b81526001600160a01b03838116600483015260248201839052841690637e54523c90604401600060405180830381600087803b15801561081857600080fd5b505af115801561082c573d6000803e3d6000fd5b505060405163b6f10c7960e01b81526001600160a01b038616925063b6f10c79915061085d906001906004016112a7565b600060405180830381600087803b15801561087757600080fd5b505af115801561088b573d6000803e3d6000fd5b50505050505050565b60048054604051632f2ff15d60e01b81526000805160206112d0833981519152928101929092526001600160a01b039081166024830152831690632f2ff15d90604401600060405180830381600087803b1580156108f157600080fd5b505af1158015610905573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600060048201526001600160a01b03848116602483015285169250632f2ff15d9150604401600060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b5050604051632f2ff15d60e01b81526000805160206112d083398151915260048201526001600160a01b03848116602483015285169250632f2ff15d9150604401600060405180830381600087803b1580156109c257600080fd5b505af11580156109d6573d6000803e3d6000fd5b5050604051632f2ff15d60e01b81527f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c60048201526001600160a01b03848116602483015285169250632f2ff15d9150604401600060405180830381600087803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b505060405163d547741f60e01b81526000805160206112d083398151915260048201523060248201526001600160a01b038516925063d547741f9150604401600060405180830381600087803b158015610ab057600080fd5b505af1158015610ac4573d6000803e3d6000fd5b505060405163d547741f60e01b81527f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c60048201523060248201526001600160a01b038516925063d547741f9150604401600060405180830381600087803b158015610b2f57600080fd5b505af1158015610b43573d6000803e3d6000fd5b50506040516313af403560e01b81526001600160a01b038481166004830152851692506313af40359150602401600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b505060405163d547741f60e01b8152600060048201523060248201526001600160a01b038516925063d547741f9150604401600060405180830381600087803b158015610bea57600080fd5b505af1158015610bfe573d6000803e3d6000fd5b505050505050565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6002546040516001600160a01b038084169216907fb92ca6a399b9270b334a0ac2215abda8e9356ed263aa3b0d59984e5095aa542290600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546040516001600160a01b038084169216907fbfe3ea820049d2b4c84d67a49dd2eec9b2db0db6e7bfa494f08d53640a13a89590600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6004546040516001600160a01b038084169216907f0b5e7be615a67a819aff3f47c967d1535cead1b98db60fafdcbf22dcaa8fa5a990600090a3600480546001600160a01b0319166001600160a01b0392909216919091179055565b600060208284031215610d7657600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051610180810167ffffffffffffffff81118282101715610db757610db7610d7d565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610de657610de6610d7d565b604052919050565b6001600160a01b038116811461063d57600080fd5b8035610e0e81610dee565b919050565b600082601f830112610e2457600080fd5b813567ffffffffffffffff811115610e3e57610e3e610d7d565b610e51601f8201601f1916602001610dbd565b818152846020838601011115610e6657600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112610e9457600080fd5b8135602067ffffffffffffffff821115610eb057610eb0610d7d565b8160051b610ebf828201610dbd565b9283528481018201928281019087851115610ed957600080fd5b83870192505b84831015610f01578235610ef281610dee565b82529183019190830190610edf565b979650505050505050565b80356001600160801b0381168114610e0e57600080fd5b600060208284031215610f3557600080fd5b813567ffffffffffffffff80821115610f4d57600080fd5b908301906101808286031215610f6257600080fd5b610f6a610d93565b610f7383610e03565b8152602083013582811115610f8757600080fd5b610f9387828601610e13565b602083015250604083013582811115610fab57600080fd5b610fb787828601610e13565b604083015250606083013582811115610fcf57600080fd5b610fdb87828601610e13565b606083015250608083013582811115610ff357600080fd5b610fff87828601610e13565b60808301525060a08301358281111561101757600080fd5b61102387828601610e83565b60a08301525061103560c08401610e03565b60c082015261104660e08401610e03565b60e0820152610100915061105b828401610f0c565b8282015261012091508183013582820152610140915061107c828401610e03565b9181019190915261016091820135918101919091529392505050565b6000602082840312156110aa57600080fd5b81356107c781610dee565b60208082526018908201527f63616c6c6572206973206e6f7420746865206f776e65722e0000000000000000604082015260600190565b6000815180845260005b81811015611112576020818501810151868301820152016110f6565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b038b8116825261014060208084018290526000929061115a8584018f6110ec565b9250848303604086015261116e838e6110ec565b92508483036060860152611182838d6110ec565b85810360808701528b518082526020808e0195509091019060005b818110156111bb57855185168352948301949183019160010161119d565b50506001600160a01b038b1660a087015293506111d792505050565b6001600160a01b03861660c08301526001600160801b03851660e083015260ff84166101008301526001600160a01b0383166101208301529b9a5050505050505050505050565b60018060a01b038516815283602082015260806040820152600061124560808301856110ec565b905082606083015295945050505050565b6001600160a01b038416815260606020820181905260009061127a908301856110ec565b9050826040830152949350505050565b60006020828403121561129c57600080fd5b81516107c781610dee565b60208101600283106112c957634e487b7160e01b600052602160045260246000fd5b9190529056fe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a26469706673582212202e1f32fe7c84e494be776168e83430a152080b7e118fc5768409bd89186a5ae464736f6c63430008170033
Verified Source Code Full Match
Compiler: v0.8.23+commit.f704f362
EVM: paris
Optimization: Yes (200 runs)
Ownable.sol 99 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.13;
interface IOwnableEvents {
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
}
interface IOwnable {
function transferOwnership(address nextOwner_) external;
function cancelOwnershipTransfer() external;
function acceptOwnership() external;
function renounceOwnership() external;
function isOwner() external view returns (bool);
function isNextOwner() external view returns (bool);
}
contract Ownable is IOwnable, IOwnableEvents {
address public owner;
address private nextOwner;
/// > [[[[[[[[[[[ Modifiers ]]]]]]]]]]]
modifier onlyOwner() {
require(isOwner(), "caller is not the owner.");
_;
}
modifier onlyNextOwner() {
require(isNextOwner(), "current owner must set caller as next owner.");
_;
}
/// @notice Initialize contract by setting the initial owner.
constructor(address owner_) {
_setInitialOwner(owner_);
}
/// @notice Initiate ownership transfer by setting nextOwner.
function transferOwnership(address nextOwner_) external override onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
/// @notice Cancel ownership transfer by deleting nextOwner.
function cancelOwnershipTransfer() external override onlyOwner {
delete nextOwner;
}
/// @notice Accepts ownership transfer by setting owner.
function acceptOwnership() external override onlyNextOwner {
delete nextOwner;
owner = msg.sender;
emit OwnershipTransferred(owner, msg.sender);
}
/// @notice Renounce ownership by setting owner to zero address.
function renounceOwnership() external override onlyOwner {
_renounceOwnership();
}
/// @notice Returns true if the caller is the current owner.
function isOwner() public view override returns (bool) {
return msg.sender == owner;
}
/// @notice Returns true if the caller is the next owner.
function isNextOwner() public view override returns (bool) {
return msg.sender == nextOwner;
}
/// > [[[[[[[[[[[ Internal Functions ]]]]]]]]]]]
function _setOwner(address previousOwner, address newOwner) internal {
owner = newOwner;
emit OwnershipTransferred(previousOwner, owner);
}
function _setInitialOwner(address newOwner) internal {
owner = newOwner;
emit OwnershipTransferred(address(0), newOwner);
}
function _renounceOwnership() internal {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
}
SignatureDropDeployer.sol 258 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "openzeppelin-contracts/contracts/proxy/Clones.sol";
import "./Ownable.sol";
interface ITWFactory {
function deployProxyByImplementation(
address _implementation,
bytes memory _data,
bytes32 _salt
) external returns (address);
}
interface ITWTokenERC1155 {
function initialize(
address _defaultAdmin,
string memory _name,
string memory _symbol,
string memory _contractURI,
address[] memory _trustedForwarders,
address _primarySaleRecipient,
address _royaltyRecipient,
uint128 _royaltyBps,
uint128 _platformFeeBps,
address _platformFeeRecipient
) external;
function mintTo(
address to,
uint256 tokenId,
string calldata uri,
uint256 amount
) external;
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function setOwner(address _newOwner) external;
function setFlatPlatformFeeInfo(
address _platformFeeRecipient,
uint256 _flatFee
) external;
enum PlatformFeeType {
Bps,
FLAT
}
function setPlatformFeeType(PlatformFeeType _feeType) external;
}
interface ISignatureDropDeployer {
event ProxyDeployed(
address indexed proxyAddress,
address indexed admin,
bytes32 salt
);
event NewMinter(address indexed oldMinter, address indexed newMinter);
event NewFactory(address indexed oldFactory, address indexed newFactory);
event NewEditionImplementation(address indexed oldImplementation, address indexed newImplementation);
struct DeployParams {
address admin;
string _name;
string _symbol;
string _contractURI;
string _uri;
address[] _trustedForwarders;
address _primarySaleRecipient;
address _royaltyRecipient;
uint128 _royaltyBps;
uint256 _platformFee;
address _platformFeeRecipient;
bytes32 salt;
}
function setMinter(address _newMinter) external;
function setTWFactoryAddress(address _newFactory) external;
function setTWEditionImplementationAddress(address _newImplementation) external;
function deploy(DeployParams memory params) external returns (address);
function predictDeterministicAddress(bytes32 _salt)
external
view
returns (address);
}
contract SignatureDropDeployer is ISignatureDropDeployer, Ownable {
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
address public TWFactoryAddress;
address public TWEditionImplementationAddress;
address public minter;
constructor(
address _owner,
address _minter,
address _factory,
address _implementation
) Ownable(_owner) {
_setMinter(_minter);
_setTWFactoryAddress(_factory);
_setTWEditionImplementationAddress(_implementation);
}
function setMinter(address _newMinter) public override onlyOwner {
_setMinter(_newMinter);
}
function setTWFactoryAddress(address _newFactory) public override onlyOwner {
_setTWFactoryAddress(_newFactory);
}
function setTWEditionImplementationAddress(address _newImplementation) public override onlyOwner {
_setTWEditionImplementationAddress(_newImplementation);
}
function deploy(DeployParams memory params)
public
override
returns (address)
{
bytes memory callData = abi.encodeWithSelector(
ITWTokenERC1155.initialize.selector,
address(this),
params._name,
params._symbol,
params._contractURI,
params._trustedForwarders,
params._primarySaleRecipient,
params._royaltyRecipient,
params._royaltyBps,
0, // no bps fee for platform
params._platformFeeRecipient
);
// Deploy proxy.
address proxyAddress = _deployProxy(callData, params.salt);
// Mint token to admin.
ITWTokenERC1155(proxyAddress).mintTo(
params.admin,
type(uint256).max,
params._uri,
0
);
// Set fees.
_setFees(
proxyAddress,
params._platformFeeRecipient,
params._platformFee
);
// Set roles.
_setRoles(proxyAddress, params.admin);
emit ProxyDeployed(proxyAddress, params.admin, params.salt);
return proxyAddress;
}
function predictDeterministicAddress(bytes32 _salt)
public
view
override
returns (address)
{
return
Clones.predictDeterministicAddress(
TWEditionImplementationAddress,
keccak256(abi.encodePacked(address(this), _salt)),
TWFactoryAddress
);
}
function _setMinter(address _newMinter) internal {
emit NewMinter(minter, _newMinter);
minter = _newMinter;
}
function _setTWFactoryAddress(address _newFactory) internal {
emit NewFactory(TWFactoryAddress, _newFactory);
TWFactoryAddress = _newFactory;
}
function _setTWEditionImplementationAddress(address _newImplementation) internal {
emit NewEditionImplementation(TWEditionImplementationAddress, _newImplementation);
TWEditionImplementationAddress = _newImplementation;
}
function _deployProxy(bytes memory callData, bytes32 salt)
internal
returns (address)
{
return
ITWFactory(TWFactoryAddress).deployProxyByImplementation(
TWEditionImplementationAddress,
callData,
salt
);
}
function _setFees(
address proxyAddress,
address _platformFeeRecipient,
uint256 _platformFee
) internal {
ITWTokenERC1155(proxyAddress).setFlatPlatformFeeInfo(
_platformFeeRecipient,
_platformFee
);
ITWTokenERC1155(proxyAddress).setPlatformFeeType(
ITWTokenERC1155.PlatformFeeType.FLAT
);
}
function _setRoles(address proxyAddress, address admin) internal {
// Grant minter role to Mirror wallet.
ITWTokenERC1155(proxyAddress).grantRole(MINTER_ROLE, minter);
// Set roles for admin.
ITWTokenERC1155(proxyAddress).grantRole(DEFAULT_ADMIN_ROLE, admin);
ITWTokenERC1155(proxyAddress).grantRole(MINTER_ROLE, admin);
ITWTokenERC1155(proxyAddress).grantRole(TRANSFER_ROLE, admin);
// Remove roles for deployer.
ITWTokenERC1155(proxyAddress).revokeRole(MINTER_ROLE, address(this));
ITWTokenERC1155(proxyAddress).revokeRole(TRANSFER_ROLE, address(this));
// Transfer ownership to admin.
ITWTokenERC1155(proxyAddress).setOwner(admin);
ITWTokenERC1155(proxyAddress).revokeRole(
DEFAULT_ADMIN_ROLE,
address(this)
);
}
}
Clones.sol 89 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)
pragma solidity ^0.8.0;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(0, 0x09, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address implementation, bytes32 salt)
internal
view
returns (address predicted)
{
return predictDeterministicAddress(implementation, salt, address(this));
}
}
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
MINTER_ROLE 0xd5391393 → bytes32
TRANSFER_ROLE 0x206b60f9 → bytes32
TWEditionImplementationAddress 0x382d9cc4 → address
TWFactoryAddress 0xe47957d3 → address
isNextOwner 0xed459df2 → bool
isOwner 0x8f32d59b → bool
minter 0x07546172 → address
owner 0x8da5cb5b → address
predictDeterministicAddress 0x5414dff0 → address
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
cancelOwnershipTransfer 0x23452b9c
No parameters
deploy 0xd741974a
tuple params
returns: address
renounceOwnership 0x715018a6
No parameters
setMinter 0xfca3b5aa
address _newMinter
setTWEditionImplementationAddress 0xc474dd0e
address _newImplementation
setTWFactoryAddress 0xb898b4b1
address _newFactory
transferOwnership 0xf2fde38b
address nextOwner_
Recent Transactions
No transactions found for this address