Address Contract Verified
Address
0x56b4e4420b3BDCEa8a92353aA307D16Ff95d91d6
Balance
0 ETH
Nonce
1
Code Size
10880 bytes
Creator
0x00df4E8d...84Ef at tx 0xdac5e49f...2a4c5b
Indexed Transactions
0 (1 on-chain, 1.3% indexed)
Contract Bytecode
10880 bytes
0x6080604052600436106101105760003560e01c8063231c228114610115578063331a6bf514610137578063393b011c146101575780633a4657b4146101775780633c34b9f0146101c257806341da7555146101e2578063462add46146101f857806356690aaf14610238578063569f6f921461026557806362f7a7ed1461028557806373709417146102b25780637e6906de146102e25780637f38902b14610325578063891407c0146103455780638f84aa091461035857806395e3b0de14610378578063a980960014610398578063c6e9d71a146103b8578063ea3bd5df146103cb578063efef39a1146103de578063f4632103146103f1578063f7bd4b8814610411578063f9f96b9e14610431575b600080fd5b34801561012157600080fd5b506101356101303660046125cb565b610461565b005b34801561014357600080fd5b50610135610152366004612616565b61051e565b34801561016357600080fd5b50610135610172366004612633565b6105dc565b34801561018357600080fd5b506101af61019236600461264c565b600760209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b3480156101ce57600080fd5b506101356101dd366004612678565b61067d565b3480156101ee57600080fd5b506101af60035481565b34801561020457600080fd5b50610228610213366004612633565b60096020526000908152604090205460ff1681565b60405190151581526020016101b9565b34801561024457600080fd5b506101af610253366004612633565b600a6020526000908152604090205481565b34801561027157600080fd5b50610135610280366004612633565b610757565b34801561029157600080fd5b506101af6102a0366004612633565b60086020526000908152604090205481565b3480156102be57600080fd5b506102286102cd366004612633565b60046020526000908152604090205460ff1681565b3480156102ee57600080fd5b506103186102fd366004612633565b6005602052600090815260409020546001600160a01b031681565b6040516101b9919061269d565b34801561033157600080fd5b50600154610318906001600160a01b031681565b6101af61035336600461264c565b610813565b34801561036457600080fd5b50600254610318906001600160a01b031681565b34801561038457600080fd5b50610135610393366004612633565b61082c565b3480156103a457600080fd5b506101af6103b3366004612633565b6108f8565b6101af6103c63660046126b1565b6109fb565b6101af6103d93660046126fb565b6113ba565b6101af6103ec366004612633565b6113d0565b3480156103fd57600080fd5b506101af61040c366004612633565b6113e0565b34801561041d57600080fd5b5061013561042c366004612633565b61148e565b34801561043d57600080fd5b5061022861044c366004612633565b60066020526000908152604090205460ff1681565b600154604051633af32abf60e01b81526001600160a01b0390911690633af32abf9061049190339060040161269d565b60206040518083038186803b1580156104a957600080fd5b505afa1580156104bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e19190612749565b6105065760405162461bcd60e51b81526004016104fd90612764565b60405180910390fd5b60009182526008602052604090912060ff9091169055565b600154604051633af32abf60e01b81526001600160a01b0390911690633af32abf9061054e90339060040161269d565b60206040518083038186803b15801561056657600080fd5b505afa15801561057a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059e9190612749565b6105ba5760405162461bcd60e51b81526004016104fd90612764565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051633af32abf60e01b81526001600160a01b0390911690633af32abf9061060c90339060040161269d565b60206040518083038186803b15801561062457600080fd5b505afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065c9190612749565b6106785760405162461bcd60e51b81526004016104fd90612764565b600355565b60015460405163a47d29cb60e01b8152600481018490526001600160a01b039091169063a47d29cb9060240160206040518083038186803b1580156106c157600080fd5b505afa1580156106d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f99190612796565b6001600160a01b0316336001600160a01b0316146107295760405162461bcd60e51b81526004016104fd906127b3565b60009182526005602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b600154604051633af32abf60e01b81526001600160a01b0390911690633af32abf9061078790339060040161269d565b60206040518083038186803b15801561079f57600080fd5b505afa1580156107b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d79190612749565b6107f35760405162461bcd60e51b81526004016104fd90612764565b6000908152600660205260409020805460ff19811660ff90911615179055565b60008034610823858583856109fb565b95945050505050565b60015460405163a47d29cb60e01b8152600481018390526001600160a01b039091169063a47d29cb9060240160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a89190612796565b6001600160a01b0316336001600160a01b0316146108d85760405162461bcd60e51b81526004016104fd906127b3565b6000908152600460205260409020805460ff19811660ff90911615179055565b60015460405163498dd0c160e01b81526004810183905260009182916001600160a01b039091169063498dd0c19060240160206040518083038186803b15801561094157600080fd5b505afa158015610955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109799190612796565b6001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016109a4919061269d565b60206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f491906127f1565b9392505050565b600060026000541415610a505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104fd565b600260009081558481526009602052604090205460ff1615610ac25760405162461bcd60e51b815260206004820152602560248201527f4d6178696d756d206e756d626572206f6620696e766f636174696f6e732072656044820152641858da195960da1b60648201526084016104fd565b60008481526006602052604090205460ff1615610b1b57333214610b1b5760405162461bcd60e51b815260206004820152601060248201526f4e6f20436f6e7472616374204275797360801b60448201526064016104fd565b600154604051633dc303c160e21b8152600481018690526000916001600160a01b03169063f70c0f049060240160206040518083038186803b158015610b6057600080fd5b505afa158015610b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9891906127f1565b60015460405163498dd0c160e01b8152600481018890529192506000916001600160a01b039091169063498dd0c19060240160206040518083038186803b158015610be257600080fd5b505afa158015610bf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1a9190612796565b9050806001600160a01b0316846001600160a01b031614610c7d5760405162461bcd60e51b815260206004820152601d60248201527f43757272656e637920616464726573736573206d757374206d6174636800000060448201526064016104fd565b6001600160a01b038116610cd357843414610cd35760405162461bcd60e51b8152602060048201526016602482015275696e636f6e73697374656e74206d73672e76616c756560501b60448201526064016104fd565b60008681526008602052604090205415610d7e57600086815260086020908152604080832054338452600783528184208a85529092529091205410610d525760405162461bcd60e51b815260206004820152601560248201527414995858da1959081b5a5b9d1a5b99c81b1a5b5a5d605a1b60448201526064016104fd565b3360009081526007602090815260408083208984529091528120805491610d7883612820565b91905055505b600154604051630d4d151360e01b81526001600160a01b038981166004830152602482018990523360448301526000921690630d4d151390606401602060405180830381600087803b158015610dd357600080fd5b505af1158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b91906127f1565b6000888152600a602052604090205490915015801590610e5057506000878152600a6020526040902054610e419060019061283b565b610e4e620f424083612868565b145b15610e6f576000878152600960205260409020805460ff191660011790555b60008781526004602052604090205460ff1615610fe1576000878152600560209081526040918290205482516305e667fd60e21b815292516001600160a01b03909116926317999ff4926004808301939192829003018186803b158015610ed557600080fd5b505afa158015610ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0d9190612749565b610f505760405162461bcd60e51b8152602060048201526014602482015273626f6e7573206d7573742062652061637469766560601b60448201526064016104fd565b6000878152600560205260409081902054905163f473237d60e01b81526001600160a01b039091169063f473237d90610f8d90339060040161269d565b602060405180830381600087803b158015610fa757600080fd5b505af1158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdf9190612749565b505b6001600160a01b0382161561135157828610156110405760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c79206d61782070726963652067746520746f6b656e207072696365000060448201526064016104fd565b34156110b45760405162461bcd60e51b815260206004820152603f60248201527f746869732070726f6a6563742061636365707473206120646966666572656e7460448201527f2063757272656e637920616e642063616e6e6f7420616363657074204554480060648201526084016104fd565b60015460405163498dd0c160e01b81526004810189905284916001600160a01b03169063498dd0c19060240160206040518083038186803b1580156110f857600080fd5b505afa15801561110c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111309190612796565b6001600160a01b031663dd62ed3e33306040518363ffffffff1660e01b815260040161115d92919061287c565b60206040518083038186803b15801561117557600080fd5b505afa158015611189573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ad91906127f1565b10156112065760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e742046756e647320417070726f76656420666f72206044820152610a8b60f31b60648201526084016104fd565b60015460405163498dd0c160e01b81526004810189905284916001600160a01b03169063498dd0c19060240160206040518083038186803b15801561124a57600080fd5b505afa15801561125e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112829190612796565b6001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016112ad919061269d565b60206040518083038186803b1580156112c557600080fd5b505afa1580156112d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112fd91906127f1565b10156113435760405162461bcd60e51b815260206004820152601560248201527424b739bab33334b1b4b2b73a103130b630b731b29760591b60448201526064016104fd565b61134c876115f1565b6113aa565b823410156113a15760405162461bcd60e51b815260206004820181905260248201527f4d7573742073656e64206d696e696d756d2076616c756520746f206d696e742160448201526064016104fd565b6113aa87611e14565b6001600055979650505050505050565b60006113c8338585856109fb565b949350505050565b600080346113c8338583856109fb565b60015460405163498dd0c160e01b81526004810183905260009182916001600160a01b039091169063498dd0c19060240160206040518083038186803b15801561142957600080fd5b505afa15801561143d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114619190612796565b6001600160a01b031663dd62ed3e33306040518363ffffffff1660e01b81526004016109a492919061287c565b600154604051633af32abf60e01b81526001600160a01b0390911690633af32abf906114be90339060040161269d565b60206040518083038186803b1580156114d657600080fd5b505afa1580156114ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150e9190612749565b61152a5760405162461bcd60e51b81526004016104fd90612764565b6001546040516346161b1160e11b81526004810183905260009182916001600160a01b0390911690638c2c36229060240160006040518083038186803b15801561157357600080fd5b505afa158015611587573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115af91908101906128ac565b5050506000898152600a6020526040902083905550909550909350505050818110156115ec576000838152600960205260409020805460ff191690555b505050565b600154604051633dc303c160e21b8152600481018390526000916001600160a01b03169063f70c0f049060240160206040518083038186803b15801561163657600080fd5b505afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e91906127f1565b905060006064600160009054906101000a90046001600160a01b03166001600160a01b0316632e9eb74f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156116c257600080fd5b505afa1580156116d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fa91906127f1565b61170490846129f3565b61170e9190612a12565b9050801561189a5760015460405163498dd0c160e01b8152600481018590526001600160a01b039091169063498dd0c19060240160206040518083038186803b15801561175a57600080fd5b505afa15801561176e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117929190612796565b6001600160a01b03166323b872dd33600160009054906101000a90046001600160a01b03166001600160a01b031663cfbf4d976040518163ffffffff1660e01b815260040160206040518083038186803b1580156117ef57600080fd5b505afa158015611803573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118279190612796565b846040518463ffffffff1660e01b815260040161184693929190612a26565b602060405180830381600087803b15801561186057600080fd5b505af1158015611874573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118989190612749565b505b60006118a6828461283b565b905060006064600354836118ba91906129f3565b6118c49190612a12565b905080156119d25760015460405163498dd0c160e01b8152600481018790526001600160a01b039091169063498dd0c19060240160206040518083038186803b15801561191057600080fd5b505afa158015611924573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119489190612796565b6002546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261197e923392909116908690600401612a26565b602060405180830381600087803b15801561199857600080fd5b505af11580156119ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d09190612749565b505b6000816119df858761283b565b6119e9919061283b565b60015460405163cc74234b60e01b81526004810189905291925060009182916001600160a01b03169063cc74234b9060240160206040518083038186803b158015611a3357600080fd5b505afa158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b91906127f1565b1115611c805760015460405163cc74234b60e01b8152600481018990526064916001600160a01b03169063cc74234b9060240160206040518083038186803b158015611ab657600080fd5b505afa158015611aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aee91906127f1565b611af890846129f3565b611b029190612a12565b90508015611c805760015460405163498dd0c160e01b8152600481018990526001600160a01b039091169063498dd0c19060240160206040518083038186803b158015611b4e57600080fd5b505afa158015611b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b869190612796565b600154604051636bd8225b60e11b8152600481018a90526001600160a01b03928316926323b872dd92339291169063d7b044b69060240160206040518083038186803b158015611bd557600080fd5b505afa158015611be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0d9190612796565b846040518463ffffffff1660e01b8152600401611c2c93929190612a26565b602060405180830381600087803b158015611c4657600080fd5b505af1158015611c5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c7e9190612749565b505b6000611c8c828461283b565b90508015611e0a5760015460405163498dd0c160e01b8152600481018a90526001600160a01b039091169063498dd0c19060240160206040518083038186803b158015611cd857600080fd5b505afa158015611cec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d109190612796565b60015460405163a47d29cb60e01b8152600481018b90526001600160a01b03928316926323b872dd92339291169063a47d29cb9060240160206040518083038186803b158015611d5f57600080fd5b505afa158015611d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d979190612796565b846040518463ffffffff1660e01b8152600401611db693929190612a26565b602060405180830381600087803b158015611dd057600080fd5b505af1158015611de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e089190612749565b505b5050505050505050565b34156125c857600154604051633dc303c160e21b8152600481018390526000916001600160a01b03169063f70c0f049060240160206040518083038186803b158015611e5f57600080fd5b505afa158015611e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9791906127f1565b600154604051633dc303c160e21b8152600481018590529192506000916001600160a01b039091169063f70c0f049060240160206040518083038186803b158015611ee157600080fd5b505afa158015611ef5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1991906127f1565b611f23903461283b565b90508015611fb557604051600090339083908381818185875af1925050503d8060008114611f6d576040519150601f19603f3d011682016040523d82523d6000602084013e611f72565b606091505b5050905080611fb35760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b60448201526064016104fd565b505b60006064600160009054906101000a90046001600160a01b03166001600160a01b0316632e9eb74f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561200757600080fd5b505afa15801561201b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203f91906127f1565b61204990856129f3565b6120539190612a12565b90508015612174576001546040805163cfbf4d9760e01b815290516000926001600160a01b03169163cfbf4d97916004808301926020929190829003018186803b1580156120a057600080fd5b505afa1580156120b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d89190612796565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114612122576040519150601f19603f3d011682016040523d82523d6000602084013e612127565b606091505b50509050806121725760405162461bcd60e51b815260206004820152601760248201527614995b99195c995c881c185e5b595b9d0819985a5b1959604a1b60448201526064016104fd565b505b6000612180828561283b565b9050600060646003548361219491906129f3565b61219e9190612a12565b90508015612242576002546040516000916001600160a01b03169083908381818185875af1925050503d80600081146121f3576040519150601f19603f3d011682016040523d82523d6000602084013e6121f8565b606091505b50509050806122405760405162461bcd60e51b815260206004820152601460248201527313dddb995c881c185e5b595b9d0819985a5b195960621b60448201526064016104fd565b505b60008161224f858861283b565b612259919061283b565b60015460405163cc74234b60e01b8152600481018a905291925060009182916001600160a01b03169063cc74234b9060240160206040518083038186803b1580156122a357600080fd5b505afa1580156122b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122db91906127f1565b11156124955760015460405163cc74234b60e01b8152600481018a90526064916001600160a01b03169063cc74234b9060240160206040518083038186803b15801561232657600080fd5b505afa15801561233a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235e91906127f1565b61236890846129f3565b6123729190612a12565b9050801561249557600154604051636bd8225b60e11b8152600481018a90526000916001600160a01b03169063d7b044b69060240160206040518083038186803b1580156123bf57600080fd5b505afa1580156123d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f79190612796565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114612441576040519150601f19603f3d011682016040523d82523d6000602084013e612446565b606091505b50509050806124935760405162461bcd60e51b81526020600482015260196024820152781059191a5d1a5bdb985b081c185e5b595b9d0819985a5b1959603a1b60448201526064016104fd565b505b60006124a1828461283b565b90508015611e085760015460405163a47d29cb60e01b8152600481018b90526000916001600160a01b03169063a47d29cb9060240160206040518083038186803b1580156124ee57600080fd5b505afa158015612502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125269190612796565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114612570576040519150601f19603f3d011682016040523d82523d6000602084013e612575565b606091505b50509050806125be5760405162461bcd60e51b8152602060048201526015602482015274105c9d1a5cdd081c185e5b595b9d0819985a5b1959605a1b60448201526064016104fd565b5050505050505050505b50565b600080604083850312156125de57600080fd5b82359150602083013560ff811681146125f657600080fd5b809150509250929050565b6001600160a01b03811681146125c857600080fd5b60006020828403121561262857600080fd5b81356109f481612601565b60006020828403121561264557600080fd5b5035919050565b6000806040838503121561265f57600080fd5b823561266a81612601565b946020939093013593505050565b6000806040838503121561268b57600080fd5b8235915060208301356125f681612601565b6001600160a01b0391909116815260200190565b600080600080608085870312156126c757600080fd5b84356126d281612601565b9350602085013592506040850135915060608501356126f081612601565b939692955090935050565b60008060006060848603121561271057600080fd5b8335925060208401359150604084013561272981612601565b809150509250925092565b8051801515811461274457600080fd5b919050565b60006020828403121561275b57600080fd5b6109f482612734565b60208082526018908201527731b0b71037b7363c9031329039b2ba10313c9030b236b4b760411b604082015260600190565b6000602082840312156127a857600080fd5b81516109f481612601565b60208082526019908201527818d85b881bdb9b1e481899481cd95d08189e48185c9d1a5cdd603a1b604082015260600190565b805161274481612601565b60006020828403121561280357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156128345761283461280a565b5060010190565b60008282101561284d5761284d61280a565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261287757612877612852565b500690565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060008060006101208a8c0312156128cb57600080fd5b89516128d681612601565b8099505060208a0151975060408a0151965060608a015195506128fb60808b01612734565b945060a08a015161290b81612601565b60c08b015160e08c0151919550935067ffffffffffffffff8082111561293057600080fd5b818c0191508c601f83011261294457600080fd5b81518181111561295657612956612896565b604051601f8201601f19908116603f0116810190838211818310171561297e5761297e612896565b816040528281528f602084870101111561299757600080fd5b600093505b828410156129bd57602084860101516020858301015260208401935061299c565b828411156129cf576000602084830101525b80965050505050506129e46101008b016127e6565b90509295985092959850929598565b6000816000190483118215151615612a0d57612a0d61280a565b500290565b600082612a2157612a21612852565b500490565b6001600160a01b03938416815291909216602082015260408101919091526060019056fea264697066735822122094b22d566f35ebdc8503249bff94c094af14e0216d0d63c711fe30dee1c7f18164736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (25 runs)
GenArt721Minter_PBAB.sol 478 lines
// SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../../interfaces/v0.8.x/IGenArt721CoreV2_PBAB.sol";
import "../../interfaces/v0.8.x/IBonusContract.sol";
import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin-4.5/contracts/utils/Strings.sol";
import "@openzeppelin-4.5/contracts/interfaces/IERC20.sol";
pragma solidity 0.8.9;
/**
* @title Powered by Art Blocks minter contract that allows tokens to be
* minted with ETH or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract GenArt721Minter_PBAB is ReentrancyGuard {
/// PBAB core contract this minter may interact with.
IGenArt721CoreV2_PBAB public genArtCoreContract;
uint256 constant ONE_MILLION = 1_000_000;
address payable public ownerAddress;
uint256 public ownerPercentage;
mapping(uint256 => bool) public projectIdToBonus;
mapping(uint256 => address) public projectIdToBonusContractAddress;
mapping(uint256 => bool) public contractFilterProject;
mapping(address => mapping(uint256 => uint256)) public projectMintCounter;
mapping(uint256 => uint256) public projectMintLimit;
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
mapping(uint256 => uint256) public projectMaxInvocations;
/**
* @notice Initializes contract to be a Minter for PBAB core contract at
* address `_genArt721Address`.
*/
constructor(address _genArt721Address) ReentrancyGuard() {
genArtCoreContract = IGenArt721CoreV2_PBAB(_genArt721Address);
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(
uint256 _projectId
) public view returns (uint256) {
uint256 balance = IERC20(
genArtCoreContract.projectIdToCurrencyAddress(_projectId)
).balanceOf(msg.sender);
return balance;
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(
uint256 _projectId
) public view returns (uint256) {
uint256 remaining = IERC20(
genArtCoreContract.projectIdToCurrencyAddress(_projectId)
).allowance(msg.sender, address(this));
return remaining;
}
/**
* @notice Sets the mint limit of a single purchaser for project
* `_projectId` to `_limit`.
* @param _projectId Project ID to set the mint limit for.
* @param _limit Number of times a given address may mint the project's
* tokens.
*/
function setProjectMintLimit(uint256 _projectId, uint8 _limit) public {
require(
genArtCoreContract.isWhitelisted(msg.sender),
"can only be set by admin"
);
projectMintLimit[_projectId] = _limit;
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
*/
function setProjectMaxInvocations(uint256 _projectId) public {
require(
genArtCoreContract.isWhitelisted(msg.sender),
"can only be set by admin"
);
uint256 maxInvocations;
uint256 invocations;
(, , invocations, maxInvocations, , , , , ) = genArtCoreContract
.projectTokenInfo(_projectId);
projectMaxInvocations[_projectId] = maxInvocations;
if (invocations < maxInvocations) {
projectMaxHasBeenInvoked[_projectId] = false;
}
}
/**
* @notice Sets the owner address to `_ownerAddress`.
* @param _ownerAddress New owner address.
*/
function setOwnerAddress(address payable _ownerAddress) public {
require(
genArtCoreContract.isWhitelisted(msg.sender),
"can only be set by admin"
);
ownerAddress = _ownerAddress;
}
/**
* @notice Sets the owner mint revenue to `_ownerPercentage` percent.
* @param _ownerPercentage New owner percentage.
*/
function setOwnerPercentage(uint256 _ownerPercentage) public {
require(
genArtCoreContract.isWhitelisted(msg.sender),
"can only be set by admin"
);
ownerPercentage = _ownerPercentage;
}
/**
* @notice Toggles if contracts are allowed to mint tokens for
* project `_projectId`.
* @param _projectId Project ID to be toggled.
*/
function toggleContractFilter(uint256 _projectId) public {
require(
genArtCoreContract.isWhitelisted(msg.sender),
"can only be set by admin"
);
contractFilterProject[_projectId] = !contractFilterProject[_projectId];
}
/**
* @notice Toggles if bonus contract for project `_projectId`.
* @param _projectId Project ID to be toggled.
*/
function artistToggleBonus(uint256 _projectId) public {
require(
msg.sender ==
genArtCoreContract.projectIdToArtistAddress(_projectId),
"can only be set by artist"
);
projectIdToBonus[_projectId] = !projectIdToBonus[_projectId];
}
/**
* @notice Sets bonus contract for project `_projectId` to
* `_bonusContractAddress`.
* @param _projectId Project ID to be toggled.
* @param _bonusContractAddress Bonus contract.
*/
function artistSetBonusContractAddress(
uint256 _projectId,
address _bonusContractAddress
) public {
require(
msg.sender ==
genArtCoreContract.projectIdToArtistAddress(_projectId),
"can only be set by artist"
);
projectIdToBonusContractAddress[_projectId] = _bonusContractAddress;
}
/**
* @notice Purchases a token from project `_projectId` with ETH.
* @param _projectId Project ID to mint a token on.
* @return _tokenId Token ID of minted token
*/
function purchase(
uint256 _projectId
) public payable returns (uint256 _tokenId) {
// pass currency address as ETH
address _currencyAddress = address(0);
uint256 _maxPricePerToken = msg.value;
return
purchaseTo(
msg.sender,
_projectId,
_maxPricePerToken,
_currencyAddress
);
}
/**
* @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token.
* @param _projectId Project ID to mint a token on.
* @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places.
* @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
* @return _tokenId Token ID of minted token
*/
function purchase(
uint256 _projectId,
uint256 _maxPricePerToken,
address _currencyAddress
) public payable returns (uint256 _tokenId) {
return
purchaseTo(
msg.sender,
_projectId,
_maxPricePerToken,
_currencyAddress
);
}
/**
* @notice Purchases a token from project `_projectId` with ETH and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return _tokenId Token ID of minted token
*/
function purchaseTo(
address _to,
uint256 _projectId
) public payable returns (uint256 _tokenId) {
// pass currency address as ETH
address _currencyAddress = address(0);
uint256 _maxPricePerToken = msg.value;
return purchaseTo(_to, _projectId, _maxPricePerToken, _currencyAddress);
}
/**
* @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places. Required if currency is ERC20.
* @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
* @return _tokenId Token ID of minted token
*/
function purchaseTo(
address _to,
uint256 _projectId,
uint256 _maxPricePerToken,
address _currencyAddress
) public payable nonReentrant returns (uint256 _tokenId) {
// CHECKS
require(
!projectMaxHasBeenInvoked[_projectId],
"Maximum number of invocations reached"
);
// if contract filter is active prevent calls from another contract
if (contractFilterProject[_projectId]) {
require(msg.sender == tx.origin, "No Contract Buys");
}
uint256 pricePerTokenInWei = genArtCoreContract
.projectIdToPricePerTokenInWei(_projectId);
address configuredCurrencyAddress = genArtCoreContract
.projectIdToCurrencyAddress(_projectId);
// validate that the currency address matches the project configured currency
require(
_currencyAddress == configuredCurrencyAddress,
"Currency addresses must match"
);
// if configured currency is ETH validate that msg.value is the same as max price per token
if (configuredCurrencyAddress == address(0)) {
require(msg.value == _maxPricePerToken, "inconsistent msg.value");
}
// limit mints per address by project
if (projectMintLimit[_projectId] > 0) {
require(
projectMintCounter[msg.sender][_projectId] <
projectMintLimit[_projectId],
"Reached minting limit"
);
// EFFECTS
projectMintCounter[msg.sender][_projectId]++;
}
uint256 tokenId = genArtCoreContract.mint(_to, _projectId, msg.sender);
// What if this overflows, since default value of uint256 is 0?
// That is intended, so that by default the minter allows infinite
// transactions, allowing the `genArtCoreContract` to stop minting
// `uint256 tokenInvocation = tokenId % ONE_MILLION;`
if (
projectMaxInvocations[_projectId] > 0 &&
tokenId % ONE_MILLION == projectMaxInvocations[_projectId] - 1
) {
projectMaxHasBeenInvoked[_projectId] = true;
}
// INTERACTIONS
// bonus contract
if (projectIdToBonus[_projectId]) {
require(
IBonusContract(projectIdToBonusContractAddress[_projectId])
.bonusIsActive(),
"bonus must be active"
);
IBonusContract(projectIdToBonusContractAddress[_projectId])
.triggerBonus(msg.sender);
}
// validate and split funds
if (configuredCurrencyAddress != address(0)) {
// validate that the specified maximum price is greater than or equal to the price per token
require(
_maxPricePerToken >= pricePerTokenInWei,
"Only max price gte token price"
);
require(
msg.value == 0,
"this project accepts a different currency and cannot accept ETH"
);
require(
IERC20(
genArtCoreContract.projectIdToCurrencyAddress(_projectId)
).allowance(msg.sender, address(this)) >= pricePerTokenInWei,
"Insufficient Funds Approved for TX"
);
require(
IERC20(
genArtCoreContract.projectIdToCurrencyAddress(_projectId)
).balanceOf(msg.sender) >= pricePerTokenInWei,
"Insufficient balance."
);
_splitFundsERC20(_projectId);
} else {
require(
msg.value >= pricePerTokenInWei,
"Must send minimum value to mint!"
);
_splitFundsETH(_projectId);
}
return tokenId;
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
if (msg.value > 0) {
uint256 pricePerTokenInWei = genArtCoreContract
.projectIdToPricePerTokenInWei(_projectId);
uint256 refund = msg.value -
genArtCoreContract.projectIdToPricePerTokenInWei(_projectId);
if (refund > 0) {
(bool success_, ) = msg.sender.call{value: refund}("");
require(success_, "Refund failed");
}
uint256 renderProviderAmount = (pricePerTokenInWei *
genArtCoreContract.renderProviderPercentage()) / 100;
if (renderProviderAmount > 0) {
(bool success_, ) = genArtCoreContract
.renderProviderAddress()
.call{value: renderProviderAmount}("");
require(success_, "Renderer payment failed");
}
uint256 remainingFunds = pricePerTokenInWei - renderProviderAmount;
uint256 ownerFunds = (remainingFunds * ownerPercentage) / 100;
if (ownerFunds > 0) {
(bool success_, ) = ownerAddress.call{value: ownerFunds}("");
require(success_, "Owner payment failed");
}
uint256 projectFunds = pricePerTokenInWei -
renderProviderAmount -
ownerFunds;
uint256 additionalPayeeAmount;
if (
genArtCoreContract.projectIdToAdditionalPayeePercentage(
_projectId
) > 0
) {
additionalPayeeAmount =
(projectFunds *
genArtCoreContract.projectIdToAdditionalPayeePercentage(
_projectId
)) /
100;
if (additionalPayeeAmount > 0) {
(bool success_, ) = genArtCoreContract
.projectIdToAdditionalPayee(_projectId)
.call{value: additionalPayeeAmount}("");
require(success_, "Additional payment failed");
}
}
uint256 creatorFunds = projectFunds - additionalPayeeAmount;
if (creatorFunds > 0) {
(bool success_, ) = genArtCoreContract
.projectIdToArtistAddress(_projectId)
.call{value: creatorFunds}("");
require(success_, "Artist payment failed");
}
}
}
/**
* @dev splits ERC-20 funds between render provider, owner, artist, and
* artist's additional payee, for a token purchased on project
`_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
uint256 pricePerTokenInWei = genArtCoreContract
.projectIdToPricePerTokenInWei(_projectId);
uint256 renderProviderAmount = (pricePerTokenInWei *
genArtCoreContract.renderProviderPercentage()) / 100;
if (renderProviderAmount > 0) {
IERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId))
.transferFrom(
msg.sender,
genArtCoreContract.renderProviderAddress(),
renderProviderAmount
);
}
uint256 remainingFunds = pricePerTokenInWei - renderProviderAmount;
uint256 ownerFunds = (remainingFunds * ownerPercentage) / 100;
if (ownerFunds > 0) {
IERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId))
.transferFrom(msg.sender, ownerAddress, ownerFunds);
}
uint256 projectFunds = pricePerTokenInWei -
renderProviderAmount -
ownerFunds;
uint256 additionalPayeeAmount;
if (
genArtCoreContract.projectIdToAdditionalPayeePercentage(
_projectId
) > 0
) {
additionalPayeeAmount =
(projectFunds *
genArtCoreContract.projectIdToAdditionalPayeePercentage(
_projectId
)) /
100;
if (additionalPayeeAmount > 0) {
IERC20(
genArtCoreContract.projectIdToCurrencyAddress(_projectId)
).transferFrom(
msg.sender,
genArtCoreContract.projectIdToAdditionalPayee(
_projectId
),
additionalPayeeAmount
);
}
}
uint256 creatorFunds = projectFunds - additionalPayeeAmount;
if (creatorFunds > 0) {
IERC20(genArtCoreContract.projectIdToCurrencyAddress(_projectId))
.transferFrom(
msg.sender,
genArtCoreContract.projectIdToArtistAddress(_projectId),
creatorFunds
);
}
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
IBonusContract.sol 10 lines
// SPDX-License-Identifier: LGPL-3.0-only
// Creatd By: Art Blocks Inc.
pragma solidity ^0.8.0;
interface IBonusContract {
function triggerBonus(address _to) external returns (bool);
function bonusIsActive() external view returns (bool);
}
IERC20.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
IGenArt721CoreV2_PBAB.sol 91 lines
// SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
pragma solidity ^0.8.0;
interface IGenArt721CoreV2_PBAB {
/**
* @notice Token ID `_tokenId` minted on project ID `_projectId` to `_to`.
*/
event Mint(
address indexed _to,
uint256 indexed _tokenId,
uint256 indexed _projectId
);
// getter function of public variable
function admin() external view returns (address);
// getter function of public variable
function nextProjectId() external view returns (uint256);
// getter function of public mapping
function tokenIdToProjectId(
uint256 tokenId
) external view returns (uint256 projectId);
function isWhitelisted(address sender) external view returns (bool);
function projectIdToCurrencySymbol(
uint256 _projectId
) external view returns (string memory);
function projectIdToCurrencyAddress(
uint256 _projectId
) external view returns (address);
function projectIdToArtistAddress(
uint256 _projectId
) external view returns (address payable);
function projectIdToPricePerTokenInWei(
uint256 _projectId
) external view returns (uint256);
function projectIdToAdditionalPayee(
uint256 _projectId
) external view returns (address payable);
function projectIdToAdditionalPayeePercentage(
uint256 _projectId
) external view returns (uint256);
function projectTokenInfo(
uint256 _projectId
)
external
view
returns (
address,
uint256,
uint256,
uint256,
bool,
address,
uint256,
string memory,
address
);
function renderProviderAddress() external view returns (address payable);
function renderProviderPercentage() external view returns (uint256);
function mint(
address _to,
uint256 _projectId,
address _by
) external returns (uint256 tokenId);
function getRoyaltyData(
uint256 _tokenId
)
external
view
returns (
address artistAddress,
address additionalPayee,
uint256 additionalPayeePercentage,
uint256 royaltyFeeByID
);
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
Read Contract
checkYourAllowanceOfProjectERC20 0xf4632103 → uint256
contractFilterProject 0xf9f96b9e → bool
genArtCoreContract 0x7f38902b → address
getYourBalanceOfProjectERC20 0xa9809600 → uint256
ownerAddress 0x8f84aa09 → address
ownerPercentage 0x41da7555 → uint256
projectIdToBonus 0x73709417 → bool
projectIdToBonusContractAddress 0x7e6906de → address
projectMaxHasBeenInvoked 0x462add46 → bool
projectMaxInvocations 0x56690aaf → uint256
projectMintCounter 0x3a4657b4 → uint256
projectMintLimit 0x62f7a7ed → uint256
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
artistSetBonusContractAddress 0x3c34b9f0
uint256 _projectId
address _bonusContractAddress
artistToggleBonus 0x95e3b0de
uint256 _projectId
purchase 0xea3bd5df
uint256 _projectId
uint256 _maxPricePerToken
address _currencyAddress
returns: uint256
purchase 0xefef39a1
uint256 _projectId
returns: uint256
purchaseTo 0x891407c0
address _to
uint256 _projectId
returns: uint256
purchaseTo 0xc6e9d71a
address _to
uint256 _projectId
uint256 _maxPricePerToken
address _currencyAddress
returns: uint256
setOwnerAddress 0x331a6bf5
address _ownerAddress
setOwnerPercentage 0x393b011c
uint256 _ownerPercentage
setProjectMaxInvocations 0xf7bd4b88
uint256 _projectId
setProjectMintLimit 0x231c2281
uint256 _projectId
uint8 _limit
toggleContractFilter 0x569f6f92
uint256 _projectId
Recent Transactions
This address has 1 on-chain transactions, but only 1.3% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →