From 19c6c59a3dcfe7f18ce605cac834a8cae276100b Mon Sep 17 00:00:00 2001 From: James Morgan Date: Tue, 10 Aug 2021 15:00:11 +0100 Subject: [PATCH] New flat code --- contracts-flat/ClaimableFundsReceiverV1.sol | 63 +++- contracts-flat/ClaimableFundsSplitterV1.sol | 63 +++- contracts-flat/CollabRoyaltiesRegistry.sol | 117 ++++-- contracts-flat/KOAccessControls.sol | 41 ++- contracts-flat/KODAV3PrimaryMarketplace.sol | 72 ++-- contracts-flat/KODAV3SecondaryMarketplace.sol | 63 ++-- contracts-flat/KnownOriginDigitalAssetV3.sol | 340 ++++++++++-------- contracts-flat/MintingFactory.sol | 70 ++-- gas-report-output.md | 338 +++++++++-------- 9 files changed, 691 insertions(+), 476 deletions(-) diff --git a/contracts-flat/ClaimableFundsReceiverV1.sol b/contracts-flat/ClaimableFundsReceiverV1.sol index 1a9d11e5..12602287 100644 --- a/contracts-flat/ClaimableFundsReceiverV1.sol +++ b/contracts-flat/ClaimableFundsReceiverV1.sol @@ -61,7 +61,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -111,8 +115,9 @@ library Address { // constructor execution. uint256 size; - // solhint-disable-next-line no-inline-assembly - assembly { size := extcodesize(account) } + assembly { + size := extcodesize(account) + } return size > 0; } @@ -135,14 +140,13 @@ library Address { function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); - // solhint-disable-next-line avoid-low-level-calls, avoid-call-value - (bool success, ) = recipient.call{ value: amount }(""); + (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A - * plain`call` is an unsafe replacement for a function call: use this + * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this @@ -159,7 +163,7 @@ library Address { * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { - return functionCall(target, data, "Address: low-level call failed"); + return functionCall(target, data, "Address: low-level call failed"); } /** @@ -168,7 +172,11 @@ library Address { * * _Available since v3.1._ */ - function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } @@ -183,7 +191,11 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } @@ -193,12 +205,16 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls - (bool success, bytes memory returndata) = target.call{ value: value }(data); + (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -218,10 +234,13 @@ library Address { * * _Available since v3.3._ */ - function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -242,15 +261,22 @@ library Address { * * _Available since v3.4._ */ - function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } - function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { + function _verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) private pure returns (bytes memory) { if (success) { return returndata; } else { @@ -258,7 +284,6 @@ library Address { if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly - // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) @@ -309,7 +334,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } diff --git a/contracts-flat/ClaimableFundsSplitterV1.sol b/contracts-flat/ClaimableFundsSplitterV1.sol index d3f101aa..e4e3fc2a 100644 --- a/contracts-flat/ClaimableFundsSplitterV1.sol +++ b/contracts-flat/ClaimableFundsSplitterV1.sol @@ -61,7 +61,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -111,8 +115,9 @@ library Address { // constructor execution. uint256 size; - // solhint-disable-next-line no-inline-assembly - assembly { size := extcodesize(account) } + assembly { + size := extcodesize(account) + } return size > 0; } @@ -135,14 +140,13 @@ library Address { function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); - // solhint-disable-next-line avoid-low-level-calls, avoid-call-value - (bool success, ) = recipient.call{ value: amount }(""); + (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A - * plain`call` is an unsafe replacement for a function call: use this + * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this @@ -159,7 +163,7 @@ library Address { * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { - return functionCall(target, data, "Address: low-level call failed"); + return functionCall(target, data, "Address: low-level call failed"); } /** @@ -168,7 +172,11 @@ library Address { * * _Available since v3.1._ */ - function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } @@ -183,7 +191,11 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } @@ -193,12 +205,16 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls - (bool success, bytes memory returndata) = target.call{ value: value }(data); + (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -218,10 +234,13 @@ library Address { * * _Available since v3.3._ */ - function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -242,15 +261,22 @@ library Address { * * _Available since v3.4._ */ - function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } - function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { + function _verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) private pure returns (bytes memory) { if (success) { return returndata; } else { @@ -258,7 +284,6 @@ library Address { if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly - // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) @@ -309,7 +334,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } diff --git a/contracts-flat/CollabRoyaltiesRegistry.sol b/contracts-flat/CollabRoyaltiesRegistry.sol index 059ad5e1..e9360871 100644 --- a/contracts-flat/CollabRoyaltiesRegistry.sol +++ b/contracts-flat/CollabRoyaltiesRegistry.sol @@ -20,7 +20,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -151,7 +150,6 @@ library Clones { * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { - // solhint-disable-next-line no-inline-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) @@ -170,7 +168,6 @@ library Clones { * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { - // solhint-disable-next-line no-inline-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) @@ -184,8 +181,11 @@ library Clones { /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ - function predictDeterministicAddress(address implementation, bytes32 salt, address deployer) internal pure returns (address predicted) { - // solhint-disable-next-line no-inline-assembly + function predictDeterministicAddress( + address implementation, + bytes32 salt, + address deployer + ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) @@ -201,7 +201,11 @@ library Clones { /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ - function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { + function predictDeterministicAddress(address implementation, bytes32 salt) + internal + view + returns (address predicted) + { return predictDeterministicAddress(implementation, salt, address(this)); } } @@ -239,8 +243,9 @@ library Address { // constructor execution. uint256 size; - // solhint-disable-next-line no-inline-assembly - assembly { size := extcodesize(account) } + assembly { + size := extcodesize(account) + } return size > 0; } @@ -263,14 +268,13 @@ library Address { function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); - // solhint-disable-next-line avoid-low-level-calls, avoid-call-value - (bool success, ) = recipient.call{ value: amount }(""); + (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A - * plain`call` is an unsafe replacement for a function call: use this + * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this @@ -287,7 +291,7 @@ library Address { * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { - return functionCall(target, data, "Address: low-level call failed"); + return functionCall(target, data, "Address: low-level call failed"); } /** @@ -296,7 +300,11 @@ library Address { * * _Available since v3.1._ */ - function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } @@ -311,7 +319,11 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } @@ -321,12 +333,16 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls - (bool success, bytes memory returndata) = target.call{ value: value }(data); + (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -346,10 +362,13 @@ library Address { * * _Available since v3.3._ */ - function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -370,15 +389,22 @@ library Address { * * _Available since v3.4._ */ - function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } - function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { + function _verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) private pure returns (bytes memory) { if (success) { return returndata; } else { @@ -386,7 +412,6 @@ library Address { if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly - // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) @@ -430,7 +455,7 @@ abstract contract Pausable is Context { /** * @dev Initializes the contract in unpaused state. */ - constructor () { + constructor() { _paused = false; } @@ -544,7 +569,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function safeTransferFrom(address from, address to, uint256 tokenId) external; + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. @@ -560,7 +589,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function transferFrom(address from, address to, uint256 tokenId) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. @@ -606,19 +639,24 @@ interface IERC721 is IERC165 { function isApprovedForAll(address owner, address operator) external view returns (bool); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; } // File: contracts/core/IERC2309.sol @@ -789,6 +827,7 @@ IHasSecondarySaleFees // Rariable / Foundation royalties function getEditionDetails(uint256 _tokenId) external view returns (address _originalCreator, address _owner, uint16 _size, uint256 _editionId, string memory _uri); function hadPrimarySaleOfToken(uint256 _tokenId) external view returns (bool); + } // File: contracts/core/Konstants.sol diff --git a/contracts-flat/KOAccessControls.sol b/contracts-flat/KOAccessControls.sol index f393ec8e..268012ed 100644 --- a/contracts-flat/KOAccessControls.sol +++ b/contracts-flat/KOAccessControls.sol @@ -20,7 +20,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -35,7 +34,7 @@ pragma solidity ^0.8.0; * @dev String operations. */ library Strings { - bytes16 private constant alphabet = "0123456789abcdef"; + bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. @@ -86,13 +85,12 @@ library Strings { buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { - buffer[i] = alphabet[value & 0xf]; + buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } - } // File: @openzeppelin/contracts/utils/introspection/IERC165.sol @@ -166,9 +164,13 @@ pragma solidity ^0.8.0; */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); + function getRoleAdmin(bytes32 role) external view returns (bytes32); + function grantRole(bytes32 role, address account) external; + function revokeRole(bytes32 role, address account) external; + function renounceRole(bytes32 role, address account) external; } @@ -212,11 +214,11 @@ interface IAccessControl { */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { - mapping (address => bool) members; + mapping(address => bool) members; bytes32 adminRole; } - mapping (bytes32 => RoleData) private _roles; + mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; @@ -266,8 +268,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { - return interfaceId == type(IAccessControl).interfaceId - || super.supportsInterface(interfaceId); + return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** @@ -285,13 +286,17 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { - if(!hasRole(role, account)) { - revert(string(abi.encodePacked( - "AccessControl: account ", - Strings.toHexString(uint160(account), 20), - " is missing role ", - Strings.toHexString(uint256(role), 32) - ))); + if (!hasRole(role, account)) { + revert( + string( + abi.encodePacked( + "AccessControl: account ", + Strings.toHexString(uint160(account), 20), + " is missing role ", + Strings.toHexString(uint256(role), 32) + ) + ) + ); } } @@ -419,7 +424,11 @@ library MerkleProof { * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ - function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { + function verify( + bytes32[] memory proof, + bytes32 root, + bytes32 leaf + ) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { diff --git a/contracts-flat/KODAV3PrimaryMarketplace.sol b/contracts-flat/KODAV3PrimaryMarketplace.sol index e3f999bc..e66a651f 100644 --- a/contracts-flat/KODAV3PrimaryMarketplace.sol +++ b/contracts-flat/KODAV3PrimaryMarketplace.sol @@ -99,7 +99,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function safeTransferFrom(address from, address to, uint256 tokenId) external; + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. @@ -115,7 +119,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function transferFrom(address from, address to, uint256 tokenId) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. @@ -161,19 +169,24 @@ interface IERC721 is IERC165 { function isApprovedForAll(address owner, address operator) external view returns (bool); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; } // File: contracts/core/IERC2309.sol @@ -344,6 +357,7 @@ IHasSecondarySaleFees // Rariable / Foundation royalties function getEditionDetails(uint256 _tokenId) external view returns (address _originalCreator, address _owner, uint16 _size, uint256 _editionId, string memory _uri); function hadPrimarySaleOfToken(uint256 _tokenId) external view returns (bool); + } // File: contracts/marketplace/IKODAV3Marketplace.sol @@ -517,7 +531,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } @@ -565,7 +579,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -602,7 +615,7 @@ abstract contract Pausable is Context { /** * @dev Initializes the contract in unpaused state. */ - constructor () { + constructor() { _paused = false; } @@ -725,7 +738,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -818,7 +835,8 @@ abstract contract BaseMarketplace is ReentrancyGuard, Pausable { } function recoverStuckETH(address payable _recipient, uint256 _amount) public onlyAdmin { - _recipient.call{value : _amount}(""); + (bool success,) = _recipient.call{value : _amount}(""); + require(success, "Unable to send recipient ETH"); emit AdminRecoverETH(_recipient, _amount); } @@ -863,7 +881,7 @@ abstract contract BaseMarketplace is ReentrancyGuard, Pausable { function _refundBidder(uint256 _id, address _receiver, uint256 _paymentAmount, address _newBidder, uint256 _newOffer) internal { (bool success,) = _receiver.call{value : _paymentAmount}(""); - if (success) { + if (!success) { emit BidderRefunded(_id, _receiver, _paymentAmount, _newBidder, _newOffer); } else { emit BidderRefundedFailed(_id, _receiver, _paymentAmount, _newBidder, _newOffer); @@ -1056,7 +1074,7 @@ abstract contract ReserveAuctionMarketplace is IReserveAuctionMarketplace, BaseM // if we are near the end, we have bids, then extend the bidding end bool isCountDownTriggered = originalBiddingEnd > 0; - if (reserveAuction.bid + msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { + if (msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { reserveAuction.biddingEnd = uint128(block.timestamp) + reserveAuctionLengthOnceReserveMet; } else if (isCountDownTriggered) { @@ -1408,7 +1426,7 @@ BuyNowMarketplace { } // emergency admin "reject" button for stuck bids - function adminRejectEditionBid(uint256 _editionId) public onlyAdmin { + function adminRejectEditionBid(uint256 _editionId) public onlyAdmin nonReentrant { Offer storage offer = editionOffers[_editionId]; require(offer.bidder != address(0), "No open bid"); @@ -1504,7 +1522,7 @@ BuyNowMarketplace { payable whenNotPaused nonReentrant { - _buyNextStep(_editionId, _msgSender(), _msgSender()); + _buyNextStep(_editionId, _msgSender()); } function buyNextStepFor(uint256 _editionId, address _buyer) @@ -1513,10 +1531,10 @@ BuyNowMarketplace { payable whenNotPaused nonReentrant { - _buyNextStep(_editionId, _msgSender(), _buyer); + _buyNextStep(_editionId, _buyer); } - function _buyNextStep(uint256 _editionId, address _invoker, address _buyer) internal { + function _buyNextStep(uint256 _editionId, address _buyer) internal { Stepped storage steppedAuction = editionStep[_editionId]; require(steppedAuction.seller != address(0), "Edition not listed for stepped auction"); require(steppedAuction.startDate <= block.timestamp, "Not started yet"); @@ -1534,7 +1552,7 @@ BuyNowMarketplace { // send back excess if supplied - will allow UX flow of setting max price to pay if (msg.value > expectedPrice) { - (bool success,) = _invoker.call{value : msg.value - expectedPrice}(""); + (bool success,) = _msgSender().call{value : msg.value - expectedPrice}(""); require(success, "failed to send overspend back"); } diff --git a/contracts-flat/KODAV3SecondaryMarketplace.sol b/contracts-flat/KODAV3SecondaryMarketplace.sol index f66e247f..a6fc27bf 100644 --- a/contracts-flat/KODAV3SecondaryMarketplace.sol +++ b/contracts-flat/KODAV3SecondaryMarketplace.sol @@ -1,6 +1,7 @@ // File: contracts/marketplace/IKODAV3Marketplace.sol // SPDX-License-Identifier: MIT + pragma solidity 0.8.4; interface IBuyNowMarketplace { @@ -231,7 +232,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function safeTransferFrom(address from, address to, uint256 tokenId) external; + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. @@ -247,7 +252,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function transferFrom(address from, address to, uint256 tokenId) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. @@ -293,19 +302,24 @@ interface IERC721 is IERC165 { function isApprovedForAll(address owner, address operator) external view returns (bool); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; } // File: contracts/core/IERC2309.sol @@ -476,6 +490,7 @@ IHasSecondarySaleFees // Rariable / Foundation royalties function getEditionDetails(uint256 _tokenId) external view returns (address _originalCreator, address _owner, uint16 _size, uint256 _editionId, string memory _uri); function hadPrimarySaleOfToken(uint256 _tokenId) external view returns (bool); + } // File: @openzeppelin/contracts/security/ReentrancyGuard.sol @@ -517,7 +532,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } @@ -565,7 +580,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -602,7 +616,7 @@ abstract contract Pausable is Context { /** * @dev Initializes the contract in unpaused state. */ - constructor () { + constructor() { _paused = false; } @@ -725,7 +739,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -818,7 +836,8 @@ abstract contract BaseMarketplace is ReentrancyGuard, Pausable { } function recoverStuckETH(address payable _recipient, uint256 _amount) public onlyAdmin { - _recipient.call{value : _amount}(""); + (bool success,) = _recipient.call{value : _amount}(""); + require(success, "Unable to send recipient ETH"); emit AdminRecoverETH(_recipient, _amount); } @@ -863,7 +882,7 @@ abstract contract BaseMarketplace is ReentrancyGuard, Pausable { function _refundBidder(uint256 _id, address _receiver, uint256 _paymentAmount, address _newBidder, uint256 _newOffer) internal { (bool success,) = _receiver.call{value : _paymentAmount}(""); - if (success) { + if (!success) { emit BidderRefunded(_id, _receiver, _paymentAmount, _newBidder, _newOffer); } else { emit BidderRefundedFailed(_id, _receiver, _paymentAmount, _newBidder, _newOffer); @@ -1056,7 +1075,7 @@ abstract contract ReserveAuctionMarketplace is IReserveAuctionMarketplace, BaseM // if we are near the end, we have bids, then extend the bidding end bool isCountDownTriggered = originalBiddingEnd > 0; - if (reserveAuction.bid + msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { + if (msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { reserveAuction.biddingEnd = uint128(block.timestamp) + reserveAuctionLengthOnceReserveMet; } else if (isCountDownTriggered) { diff --git a/contracts-flat/KnownOriginDigitalAssetV3.sol b/contracts-flat/KnownOriginDigitalAssetV3.sol index d9750ef6..a46870e4 100644 --- a/contracts-flat/KnownOriginDigitalAssetV3.sol +++ b/contracts-flat/KnownOriginDigitalAssetV3.sol @@ -119,7 +119,12 @@ interface IERC721Receiver { * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ - function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); + function onERC721Received( + address operator, + address from, + uint256 tokenId, + bytes calldata data + ) external returns (bytes4); } // File: @openzeppelin/contracts/utils/Address.sol @@ -155,8 +160,9 @@ library Address { // constructor execution. uint256 size; - // solhint-disable-next-line no-inline-assembly - assembly { size := extcodesize(account) } + assembly { + size := extcodesize(account) + } return size > 0; } @@ -179,14 +185,13 @@ library Address { function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); - // solhint-disable-next-line avoid-low-level-calls, avoid-call-value - (bool success, ) = recipient.call{ value: amount }(""); + (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A - * plain`call` is an unsafe replacement for a function call: use this + * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this @@ -203,7 +208,7 @@ library Address { * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { - return functionCall(target, data, "Address: low-level call failed"); + return functionCall(target, data, "Address: low-level call failed"); } /** @@ -212,7 +217,11 @@ library Address { * * _Available since v3.1._ */ - function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } @@ -227,7 +236,11 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } @@ -237,12 +250,16 @@ library Address { * * _Available since v3.1._ */ - function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls - (bool success, bytes memory returndata) = target.call{ value: value }(data); + (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -262,10 +279,13 @@ library Address { * * _Available since v3.3._ */ - function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } @@ -286,15 +306,22 @@ library Address { * * _Available since v3.4._ */ - function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); - // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } - function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { + function _verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) private pure returns (bytes memory) { if (success) { return returndata; } else { @@ -302,7 +329,6 @@ library Address { if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly - // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) @@ -472,7 +498,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -543,7 +573,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function safeTransferFrom(address from, address to, uint256 tokenId) external; + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. @@ -559,7 +593,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function transferFrom(address from, address to, uint256 tokenId) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. @@ -605,19 +643,24 @@ interface IERC721 is IERC165 { function isApprovedForAll(address owner, address operator) external view returns (bool); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; } // File: @openzeppelin/contracts/utils/structs/EnumerableSet.sol @@ -663,10 +706,9 @@ library EnumerableSet { struct Set { // Storage of set values bytes32[] _values; - // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. - mapping (bytes32 => uint256) _indexes; + mapping(bytes32 => uint256) _indexes; } /** @@ -697,7 +739,8 @@ library EnumerableSet { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; - if (valueIndex != 0) { // Equivalent to contains(set, value) + if (valueIndex != 0) { + // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. @@ -705,15 +748,14 @@ library EnumerableSet { uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; - // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs - // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. + if (lastIndex != toDeleteIndex) { + bytes32 lastvalue = set._values[lastIndex]; - bytes32 lastvalue = set._values[lastIndex]; - - // Move the last value to the index where the value to delete is - set._values[toDeleteIndex] = lastvalue; - // Update the index for the moved value - set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex + // Move the last value to the index where the value to delete is + set._values[toDeleteIndex] = lastvalue; + // Update the index for the moved value + set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex + } // Delete the slot where the moved value was stored set._values.pop(); @@ -741,18 +783,17 @@ library EnumerableSet { return set._values.length; } - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ function _at(Set storage set, uint256 index) private view returns (bytes32) { - require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } @@ -796,16 +837,16 @@ library EnumerableSet { return _length(set._inner); } - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } @@ -850,21 +891,20 @@ library EnumerableSet { return _length(set._inner); } - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } - // UintSet struct UintSet { @@ -905,16 +945,16 @@ library EnumerableSet { return _length(set._inner); } - /** - * @dev Returns the value stored at position `index` in the set. O(1). - * - * Note that there are no guarantees on the ordering of values inside the - * array, and it may change when more values are added or removed. - * - * Requirements: - * - * - `index` must be strictly less than {length}. - */ + /** + * @dev Returns the value stored at position `index` in the set. O(1). + * + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } @@ -959,7 +999,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } @@ -1007,7 +1047,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -1135,6 +1174,7 @@ IHasSecondarySaleFees // Rariable / Foundation royalties function getEditionDetails(uint256 _tokenId) external view returns (address _originalCreator, address _owner, uint16 _size, uint256 _editionId, string memory _uri); function hadPrimarySaleOfToken(uint256 _tokenId) external view returns (bool); + } // File: contracts/core/composable/TopDownERC20Composable.sol @@ -1233,8 +1273,7 @@ abstract contract TopDownERC20Composable is ERC998ERC20TopDown, ERC998ERC20TopDo ); require(_from == _msgSender(), "Must be token owner"); - IKODAV3 koda = IKODAV3(address(this)); - uint256 editionId = koda.getEditionIdOfToken(_tokenId); + uint256 editionId = IKODAV3(address(this)).getEditionIdOfToken(_tokenId); bool editionAlreadyContainsERC20 = ERC20sEmbeddedInEdition[editionId].contains(_erc20Contract); bool nftAlreadyContainsERC20 = ERC20sEmbeddedInNft[_tokenId].contains(_erc20Contract); @@ -1256,8 +1295,7 @@ abstract contract TopDownERC20Composable is ERC998ERC20TopDown, ERC998ERC20TopDo function _composeERC20IntoEdition(address _from, uint256 _editionId, address _erc20Contract, uint256 _value) internal nonReentrant { require(_value > 0, "Value cannot be zero"); - bool editionAlreadyContainsERC20 = ERC20sEmbeddedInEdition[_editionId].contains(_erc20Contract); - require(!editionAlreadyContainsERC20, "Edition already contains ERC20"); + require(!ERC20sEmbeddedInEdition[_editionId].contains(_erc20Contract), "Edition already contains ERC20"); ERC20sEmbeddedInEdition[_editionId].add(_erc20Contract); editionTokenERC20Balances[_editionId][_erc20Contract] = editionTokenERC20Balances[_editionId][_erc20Contract] + _value; @@ -1268,16 +1306,14 @@ abstract contract TopDownERC20Composable is ERC998ERC20TopDown, ERC998ERC20TopDo } function totalERC20Contracts(uint256 _tokenId) override public view returns (uint256) { - IKODAV3 koda = IKODAV3(address(this)); - uint256 editionId = koda.getEditionIdOfToken(_tokenId); + uint256 editionId = IKODAV3(address(this)).getEditionIdOfToken(_tokenId); return ERC20sEmbeddedInNft[_tokenId].length() + ERC20sEmbeddedInEdition[editionId].length(); } function erc20ContractByIndex(uint256 _tokenId, uint256 _index) override external view returns (address) { uint256 numOfERC20sInNFT = ERC20sEmbeddedInNft[_tokenId].length(); if (_index >= numOfERC20sInNFT) { - IKODAV3 koda = IKODAV3(address(this)); - uint256 editionId = koda.getEditionIdOfToken(_tokenId); + uint256 editionId = IKODAV3(address(this)).getEditionIdOfToken(_tokenId); return ERC20sEmbeddedInEdition[editionId].at(_index - numOfERC20sInNFT); } @@ -1555,11 +1591,11 @@ pragma solidity 0.8.4; /// @notice EIP-2309 Consecutive batch mint /// @notice ERC-998 Top-down ERC-20 composable contract KnownOriginDigitalAssetV3 is - TopDownERC20Composable, - TopDownSimpleERC721Composable, - BaseKoda, - ERC165Storage, - IKODAV3Minter { +TopDownERC20Composable, +TopDownSimpleERC721Composable, +BaseKoda, +ERC165Storage, +IKODAV3Minter { event EditionURIUpdated(uint256 indexed _editionId); event EditionSalesDisabledToggled(uint256 indexed _editionId, bool _oldValue, bool _newValue); @@ -1578,6 +1614,15 @@ contract KnownOriginDigitalAssetV3 is require(_editionExists(_editionId), "Edition does not exist"); } + modifier validateCreator(uint256 _editionId) { + address creator = getCreatorOfEdition(_editionId); + require( + _msgSender() == creator || accessControls.isVerifiedArtistProxy(creator, _msgSender()), + "Only creator or proxy" + ); + _; + } + /// @notice Token name string public constant name = "KnownOriginDigitalAsset"; @@ -1623,9 +1668,6 @@ contract KnownOriginDigitalAssetV3 is /// @notice Optional one time use storage slot for additional token metadata such ass peramweb metadata mapping(uint256 => string) public sealedTokenMetaData; - /// @notice Optional storage slot for additional unlockable content - mapping(uint256 => string) public additionalEditionUnlockableSlot; - /// @notice Allows a creator to disable sales of their edition mapping(uint256 => bool) public editionSalesDisabled; @@ -1634,7 +1676,7 @@ contract KnownOriginDigitalAssetV3 is IERC2981 _royaltiesRegistryProxy, uint256 _editionPointer ) BaseKoda(_accessControls) { - + // starting point for new edition IDs editionPointer = _editionPointer; // optional registry address - can be constructed as zero address @@ -1663,7 +1705,6 @@ contract KnownOriginDigitalAssetV3 is } /// @notice Mints an edition token batch and composes ERC20s for every token in the edition - /// @dev there is a limit on the number of ERC20s that can be embedded in an edition function mintBatchEditionAndComposeERC20s( uint16 _editionSize, address _to, @@ -1685,7 +1726,7 @@ contract KnownOriginDigitalAssetV3 is } function _mintBatchEdition(uint16 _editionSize, address _to, string calldata _uri) internal returns (uint256) { - require(_editionSize > 0 && _editionSize <= MAX_EDITION_SIZE, "Invalid edition size"); + require(_editionSize > 0 && _editionSize <= MAX_EDITION_SIZE, "Invalid size"); uint256 start = generateNextEditionNumber(); @@ -1711,7 +1752,7 @@ contract KnownOriginDigitalAssetV3 is override onlyContract returns (uint256 _editionId) { - require(_editionSize > 0 && _editionSize <= MAX_EDITION_SIZE, "Invalid edition size"); + require(_editionSize > 0 && _editionSize <= MAX_EDITION_SIZE, "Invalid size"); uint256 start = generateNextEditionNumber(); @@ -1730,11 +1771,13 @@ contract KnownOriginDigitalAssetV3 is } /// @notice Allows the creator of an edition to update the token URI provided that no primary sales have been made - function updateURIIfNoSaleMade(uint256 _editionId, string calldata _newURI) external override { - require(_msgSender() == editionDetails[_editionId].creator, "Not creator"); + function updateURIIfNoSaleMade(uint256 _editionId, string calldata _newURI) + external + override + validateCreator(_editionId) { require( !hasMadePrimarySale(_editionId) && (!tokenUriResolverActive() || !tokenUriResolver.isDefined(_editionId, 0)), - "Invalid Edition state" + "Invalid state" ); editionDetails[_editionId].uri = _newURI; @@ -1808,6 +1851,7 @@ contract KnownOriginDigitalAssetV3 is ); } + /// @notice If primary sales for an edition are disabled function isEditionSalesDisabled(uint256 _editionId) external view override returns (bool) { return editionSalesDisabled[_editionId]; @@ -1824,7 +1868,7 @@ contract KnownOriginDigitalAssetV3 is require( creator == _msgSender() || accessControls.hasAdminRole(_msgSender()), - "Only creator or platform admin" + "Only creator or admin" ); emit EditionSalesDisabledToggled(_editionId, editionSalesDisabled[_editionId], !editionSalesDisabled[_editionId]); @@ -1961,7 +2005,7 @@ contract KnownOriginDigitalAssetV3 is return feeRecipients; } - function getFeeBps(uint256 _tokenId) external view override returns (uint[] memory) { + function getFeeBps(uint256) external view override returns (uint[] memory) { uint[] memory feeBps = new uint[](1); feeBps[0] = uint(secondarySaleRoyalty) / basisPointsModulo; // convert to basis points @@ -2006,7 +2050,7 @@ contract KnownOriginDigitalAssetV3 is view override returns (address receiver, address creator, uint256 tokenId) { - require(!editionSalesDisabled[_editionId], "Edition sales disabled"); + require(!editionSalesDisabled[_editionId], "Edition disabled"); uint256 _tokenId = getNextAvailablePrimarySaleToken(_editionId); address _creator = _getCreatorOfEdition(_editionId); @@ -2030,7 +2074,7 @@ contract KnownOriginDigitalAssetV3 is return tokenId; } } - revert("No tokens left on the primary market"); + revert("Primary market exhausted"); } /// @notice Starting from the last token in an edition and going down the first, returns the next unsold token (if any) @@ -2045,7 +2089,7 @@ contract KnownOriginDigitalAssetV3 is } highestTokenId--; } - revert("No tokens left on the primary market"); + revert("Primary market exhausted"); } /// @notice Using the reverse token ID logic of an edition, returns next token ID and associated royalty information @@ -2054,7 +2098,7 @@ contract KnownOriginDigitalAssetV3 is view override returns (address receiver, address creator, uint256 tokenId) { - require(!editionSalesDisabled[_editionId], "Edition sales disabled"); + require(!editionSalesDisabled[_editionId], "Edition disabled"); uint256 _tokenId = getReverseAvailablePrimarySaleToken(_editionId); address _creator = _getCreatorOfEdition(_editionId); @@ -2083,7 +2127,6 @@ contract KnownOriginDigitalAssetV3 is return true; } } - return false; } @@ -2154,7 +2197,7 @@ contract KnownOriginDigitalAssetV3 is ); require( selector == ERC721_RECEIVED, - "ERC721_INVALID_SELECTOR" + "Invalid selector" ); } } @@ -2178,12 +2221,12 @@ contract KnownOriginDigitalAssetV3 is function _transferFrom(address _from, address _to, uint256 _tokenId) private { // enforce not being able to send to zero as we have explicit rules what a minted but unbound owner is - require(_to != address(0), "ERC721_ZERO_TO_ADDRESS"); + require(_to != address(0), "Invalid to address"); // Ensure the owner is the sender address owner = _ownerOf(_tokenId, _editionFromTokenId(_tokenId)); - require(owner != address(0), "ERC721_ZERO_OWNER"); - require(_from == owner, "ERC721_OWNER_MISMATCH"); + require(owner != address(0), "Invalid owner"); + require(_from == owner, "Owner mismatch"); address spender = _msgSender(); address approvedAddress = getApproved(_tokenId); @@ -2191,7 +2234,7 @@ contract KnownOriginDigitalAssetV3 is spender == owner // sending to myself || isApprovedForAll(owner, spender) // is approved to send any behalf of owner || approvedAddress == spender, // is approved to move this token ID - "ERC721_INVALID_SPENDER" + "Invalid spender" ); // Ensure approval for token ID is cleared @@ -2214,7 +2257,7 @@ contract KnownOriginDigitalAssetV3 is function ownerOf(uint256 _tokenId) override public view returns (address) { uint256 editionId = _editionFromTokenId(_tokenId); address owner = _ownerOf(_tokenId, editionId); - require(owner != address(0), "ERC721_ZERO_OWNER"); + require(owner != address(0), "Invalid owner"); return owner; } @@ -2246,8 +2289,8 @@ contract KnownOriginDigitalAssetV3 is /// @param _tokenId The NFT to approve function approve(address _approved, uint256 _tokenId) override external { address owner = ownerOf(_tokenId); - require(_approved != owner, "ERC721_APPROVED_IS_OWNER"); - require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721_INVALID_SENDER"); + require(_approved != owner, "Approved in owner"); + require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "Invalid sender"); approvals[_tokenId] = _approved; emit Approval(owner, _approved, _tokenId); } @@ -2273,7 +2316,7 @@ contract KnownOriginDigitalAssetV3 is /// @param _owner An address for whom to query the balance /// @return The number of NFTs owned by `_owner`, possibly zero function balanceOf(address _owner) override external view returns (uint256) { - require(_owner != address(0), "ERC721_ZERO_OWNER"); + require(_owner != address(0), "Invalid owner"); return balances[_owner]; } @@ -2329,38 +2372,35 @@ contract KnownOriginDigitalAssetV3 is // Creator functions // /////////////////////// - /// @notice Optional metadata storage slot which allows the creator to set an additional metadata blob on the edition - function lockInAdditionalMetaData(uint256 _editionId, string calldata _metadata) external { - address creator = getCreatorOfEdition(_editionId); - require( - _msgSender() == creator || accessControls.isVerifiedArtistProxy(creator, _msgSender()), - "Unable to set when not creator" - ); + function composeERC20sAsCreator(uint16 _editionId, address[] calldata _erc20s, uint256[] calldata _amounts) + external + validateCreator(_editionId) { + require(!isEditionSoldOut(_editionId), "Edition soldout"); - require(bytes(sealedEditionMetaData[_editionId]).length == 0, "can only be set once"); - sealedEditionMetaData[_editionId] = _metadata; - emit SealedEditionMetaDataSet(_editionId); - } + uint256 totalErc20s = _erc20s.length; + require(totalErc20s > 0 && totalErc20s == _amounts.length, "Tokens invalid"); - /// @notice Optional storage slot which allows the creator to set an additional unlockable blob on the edition - function lockInUnlockableContent(uint256 _editionId, string calldata _content) external { - address creator = getCreatorOfEdition(_editionId); - require( - _msgSender() == creator || accessControls.isVerifiedArtistProxy(creator, _msgSender()), - "Unable to set when not creator" - ); + for (uint i = 0; i < totalErc20s; i++) { + _composeERC20IntoEdition(_msgSender(), _editionId, _erc20s[i], _amounts[i]); + } + } - additionalEditionUnlockableSlot[_editionId] = _content; - emit AdditionalEditionUnlockableSet(_editionId); + /// @notice Optional metadata storage slot which allows the creator to set an additional metadata blob on the edition + function lockInAdditionalMetaData(uint256 _editionId, string calldata _metadata) + external + validateCreator(_editionId) { + require(bytes(sealedEditionMetaData[_editionId]).length == 0, "Already set"); + sealedEditionMetaData[_editionId] = _metadata; + emit SealedEditionMetaDataSet(_editionId); } /// @notice Optional metadata storage slot which allows a token owner to set an additional metadata blob on the token function lockInAdditionalTokenMetaData(uint256 _tokenId, string calldata _metadata) external { require( _msgSender() == ownerOf(_tokenId) || accessControls.hasContractRole(_msgSender()), - "Unable to set when not owner or contract" + "Only owner or contract" ); - require(bytes(sealedTokenMetaData[_tokenId]).length == 0, "can only be set once"); + require(bytes(sealedTokenMetaData[_tokenId]).length == 0, "Already set"); sealedTokenMetaData[_tokenId] = _metadata; emit SealedTokenMetaDataSet(_tokenId); } diff --git a/contracts-flat/MintingFactory.sol b/contracts-flat/MintingFactory.sol index ef7ec432..18e85508 100644 --- a/contracts-flat/MintingFactory.sol +++ b/contracts-flat/MintingFactory.sol @@ -20,7 +20,6 @@ abstract contract Context { } function _msgData() internal view virtual returns (bytes calldata) { - this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } @@ -141,7 +140,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function safeTransferFrom(address from, address to, uint256 tokenId) external; + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. @@ -157,7 +160,11 @@ interface IERC721 is IERC165 { * * Emits a {Transfer} event. */ - function transferFrom(address from, address to, uint256 tokenId) external; + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. @@ -203,19 +210,24 @@ interface IERC721 is IERC165 { function isApprovedForAll(address owner, address operator) external view returns (bool); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; } // File: contracts/core/IERC2309.sol @@ -386,6 +398,7 @@ IHasSecondarySaleFees // Rariable / Foundation royalties function getEditionDetails(uint256 _tokenId) external view returns (address _originalCreator, address _owner, uint16 _size, uint256 _editionId, string memory _uri); function hadPrimarySaleOfToken(uint256 _tokenId) external view returns (bool); + } // File: contracts/marketplace/IKODAV3Marketplace.sol @@ -559,7 +572,7 @@ abstract contract ReentrancyGuard { uint256 private _status; - constructor () { + constructor() { _status = _NOT_ENTERED; } @@ -617,7 +630,7 @@ abstract contract Pausable is Context { /** * @dev Initializes the contract in unpaused state. */ - constructor () { + constructor() { _paused = false; } @@ -740,7 +753,11 @@ interface IERC20 { * * Emits a {Transfer} event. */ - function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to @@ -833,7 +850,8 @@ abstract contract BaseMarketplace is ReentrancyGuard, Pausable { } function recoverStuckETH(address payable _recipient, uint256 _amount) public onlyAdmin { - _recipient.call{value : _amount}(""); + (bool success,) = _recipient.call{value : _amount}(""); + require(success, "Unable to send recipient ETH"); emit AdminRecoverETH(_recipient, _amount); } @@ -1071,7 +1089,7 @@ abstract contract ReserveAuctionMarketplace is IReserveAuctionMarketplace, BaseM // if we are near the end, we have bids, then extend the bidding end bool isCountDownTriggered = originalBiddingEnd > 0; - if (reserveAuction.bid + msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { + if (msg.value >= reserveAuction.reservePrice && !isCountDownTriggered) { reserveAuction.biddingEnd = uint128(block.timestamp) + reserveAuctionLengthOnceReserveMet; } else if (isCountDownTriggered) { @@ -1423,7 +1441,7 @@ BuyNowMarketplace { } // emergency admin "reject" button for stuck bids - function adminRejectEditionBid(uint256 _editionId) public onlyAdmin { + function adminRejectEditionBid(uint256 _editionId) public onlyAdmin nonReentrant { Offer storage offer = editionOffers[_editionId]; require(offer.bidder != address(0), "No open bid"); @@ -1519,7 +1537,7 @@ BuyNowMarketplace { payable whenNotPaused nonReentrant { - _buyNextStep(_editionId, _msgSender(), _msgSender()); + _buyNextStep(_editionId, _msgSender()); } function buyNextStepFor(uint256 _editionId, address _buyer) @@ -1528,10 +1546,10 @@ BuyNowMarketplace { payable whenNotPaused nonReentrant { - _buyNextStep(_editionId, _msgSender(), _buyer); + _buyNextStep(_editionId, _buyer); } - function _buyNextStep(uint256 _editionId, address _invoker, address _buyer) internal { + function _buyNextStep(uint256 _editionId, address _buyer) internal { Stepped storage steppedAuction = editionStep[_editionId]; require(steppedAuction.seller != address(0), "Edition not listed for stepped auction"); require(steppedAuction.startDate <= block.timestamp, "Not started yet"); @@ -1549,7 +1567,7 @@ BuyNowMarketplace { // send back excess if supplied - will allow UX flow of setting max price to pay if (msg.value > expectedPrice) { - (bool success,) = _invoker.call{value : msg.value - expectedPrice}(""); + (bool success,) = _msgSender().call{value : msg.value - expectedPrice}(""); require(success, "failed to send overspend back"); } diff --git a/gas-report-output.md b/gas-report-output.md index 7e21be4f..93e6a8e2 100644 --- a/gas-report-output.md +++ b/gas-report-output.md @@ -1,323 +1,345 @@ ·-------------------------------------------------------------------------------------------------------------------------------------|---------------------------|-------------|-----------------------------· | Solc version: 0.8.4 · Optimizer enabled: true · Runs: 200 · Block limit: 12450000 gas │ ······································································································································|···························|·············|······························ -| Methods · 75 gwei/gas · 2223.08 usd/eth │ +| Methods · 75 gwei/gas · 3228.94 usd/eth │ ·······························|······································································································|·············|·············|·············|···············|·············· | Contract · Method · Min · Max · Avg · # calls · usd (avg) │ ·······························|······································································································|·············|·············|·············|···············|·············· -| BeaconBasedRegistry · addBeacon(string,address) · - · - · 47284 · 27 · 7.88 │ +| BeaconBasedRegistry · addBeacon(string,address) · 47272 · 47284 · 47282 · 27 · 11.45 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| BeaconBasedRegistry · setupRoyalty(uint256,string,address[],uint256[]) · 431869 · 495208 · 486148 · 14 · 81.06 │ +| BeaconBasedRegistry · setupRoyalty(uint256,string,address[],uint256[]) · 431869 · 495208 · 486148 · 14 · 117.73 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| ClaimableFundsReceiverV1 · drain() · 77076 · 99639 · 88358 · 2 · 14.73 │ +| ClaimableFundsReceiverV1 · drain() · 77076 · 99639 · 88358 · 2 · 21.40 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| ClaimableFundsReceiverV1 · drainERC20(address) · - · - · 120231 · 1 · 20.05 │ +| ClaimableFundsReceiverV1 · drainERC20(address) · - · - · 120039 · 1 · 29.07 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| ClaimableFundsReceiverV1 · init(address[],uint256[]) · - · - · 224822 · 5 · 37.48 │ +| ClaimableFundsReceiverV1 · init(address[],uint256[]) · - · - · 224822 · 5 · 54.45 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CloneBasedRegistry · addHandler(string,address) · - · - · 47284 · 25 · 7.88 │ +| CloneBasedRegistry · addHandler(string,address) · 47272 · 47284 · 47283 · 25 · 11.45 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CloneBasedRegistry · setupRoyalty(uint256,string,address[],uint256[]) · 239620 · 302538 · 277183 · 14 · 46.21 │ +| CloneBasedRegistry · setupRoyalty(uint256,string,address[],uint256[]) · 239620 · 302538 · 277183 · 14 · 67.13 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · addHandler(address) · 53244 · 53256 · 53255 · 24 · 8.88 │ +| CollabRoyaltiesRegistry · addHandler(address) · 53266 · 53278 · 53277 · 23 · 12.90 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · createAndUseRoyaltiesRecipient(uint256,address,address[],uint256[]) · - · - · 340166 · 1 · 56.72 │ +| CollabRoyaltiesRegistry · createAndUseRoyaltiesRecipient(uint256,address,address[],uint256[]) · - · - · 340055 · 1 · 82.35 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · createRoyaltiesRecipient(uint256,bytes32[],address,address[],uint256[]) · 271601 · 318017 · 311648 · 15 · 51.96 │ +| CollabRoyaltiesRegistry · createRoyaltiesRecipient(address,address[],uint256[]) · 260482 · 306910 · 300710 · 15 · 72.82 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · emergencyResetRoyaltiesHandler(uint256) · - · - · 20595 · 1 · 3.43 │ +| CollabRoyaltiesRegistry · emergencyResetRoyaltiesHandler(uint256) · - · - · 20595 · 1 · 4.99 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · setAccessControls(address) · - · - · 33931 · 1 · 5.66 │ +| CollabRoyaltiesRegistry · setAccessControls(address) · - · - · 33931 · 1 · 8.22 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · setKoda(address) · 35896 · 53008 · 52589 · 41 · 8.77 │ +| CollabRoyaltiesRegistry · setKoda(address) · 35918 · 53030 · 52601 · 40 · 12.74 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · setRoyaltyAmount(uint256) · - · - · 35511 · 1 · 5.92 │ +| CollabRoyaltiesRegistry · setRoyaltyAmount(uint256) · - · - · 35533 · 1 · 8.61 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · usePredeterminedRoyaltiesRecipient(uint256,address,address[],uint256[]) · - · - · 59836 · 2 · 9.98 │ +| CollabRoyaltiesRegistry · usePredeterminedRoyaltiesRecipient(uint256,address,address[],uint256[]) · 59868 · 59880 · 59874 · 2 · 14.50 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · useRoyaltiesRecipient(uint256,address) · 57940 · 57952 · 57951 · 10 · 9.66 │ +| CollabRoyaltiesRegistry · useRoyaltiesRecipient(uint256,address) · 57939 · 57951 · 57950 · 10 · 14.03 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| FundsReceiver · init(address[],uint256[]) · - · - · 206867 · 3 · 34.49 │ +| FundsReceiver · init(address[],uint256[]) · - · - · 206867 · 3 · 50.10 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| FundsSplitter · init(address[],uint256[]) · - · - · 223965 · 3 · 37.34 │ +| FundsSplitter · init(address[],uint256[]) · - · - · 223965 · 3 · 54.24 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · approve(address,uint256) · 19131 · 53784 · 46381 · 872 · 7.73 │ +| KnownOriginDigitalAssetV3 · approve(address,uint256) · 19075 · 53728 · 46325 · 872 · 11.22 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · batchTransferFrom(address,address,uint256[]) · 71535 · 1515462 · 361889 · 6 · 60.34 │ +| KnownOriginDigitalAssetV3 · batchTransferFrom(address,address,uint256[]) · 71557 · 1514884 · 361787 · 6 · 87.61 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · consecutiveBatchTransferFrom(address,address,uint256,uint256) · 66885 · 137084 · 113684 · 3 · 18.95 │ +| KnownOriginDigitalAssetV3 · composeNFTIntoKodaToken(uint256,address,uint256) · 115365 · 115377 · 115372 · 5 · 27.94 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · getERC20(address,uint256,address,uint256) · 71743 · 153704 · 137110 · 14 · 22.86 │ +| KnownOriginDigitalAssetV3 · consecutiveBatchTransferFrom(address,address,uint256,uint256) · 66929 · 137092 · 113704 · 3 · 27.54 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · getERC20s(address,uint256[],address,uint256) · - · - · 1112041 · 1 · 185.41 │ +| KnownOriginDigitalAssetV3 · getERC20(address,uint256,address,uint256) · 71776 · 153737 · 137142 · 14 · 33.21 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · lockInAdditionalMetaData(uint256,string) · 48570 · 56495 · 50155 · 5 · 8.36 │ +| KnownOriginDigitalAssetV3 · getERC20s(address,uint256[],address,uint256) · - · - · 1111701 · 1 · 269.22 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · lockInAdditionalTokenMetaData(uint256,string) · - · - · 51484 · 3 · 8.58 │ +| KnownOriginDigitalAssetV3 · lockInAdditionalMetaData(uint256,string) · 48619 · 56544 · 50204 · 5 · 12.16 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · lockInUnlockableContent(uint256,string) · 48355 · 56280 · 52318 · 2 · 8.72 │ +| KnownOriginDigitalAssetV3 · lockInAdditionalTokenMetaData(uint256,string) · - · - · 51533 · 3 · 12.48 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · mintBatchEdition(uint96,address,string) · 88799 · 339594 · 139971 · 1756 · 23.34 │ +| KnownOriginDigitalAssetV3 · mintBatchEdition(uint16,address,string) · 88802 · 339597 · 139668 · 1807 · 33.82 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · mintBatchEditionAndComposeERC20s(uint96,address,string,address[],uint256[]) · - · - · 246500 · 6 · 41.10 │ +| KnownOriginDigitalAssetV3 · mintBatchEditionAndComposeERC20s(uint16,address,string,address[],uint256[]) · - · - · 246377 · 6 · 59.67 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · mintConsecutiveBatchEdition(uint96,address,string) · 150944 · 173464 · 171353 · 224 · 28.57 │ +| KnownOriginDigitalAssetV3 · mintConsecutiveBatchEdition(uint16,address,string) · 150914 · 173434 · 171323 · 224 · 41.49 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · reportArtistAccount(address,bool) · 21663 · 53775 · 37719 · 2 · 6.29 │ +| KnownOriginDigitalAssetV3 · reportArtistAccount(address,bool) · 21773 · 53885 · 37829 · 2 · 9.16 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · reportEditionId(uint256,bool) · 21362 · 53474 · 37418 · 2 · 6.24 │ +| KnownOriginDigitalAssetV3 · reportEditionId(uint256,bool) · 21362 · 53474 · 37418 · 2 · 9.06 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · safeTransferFrom(address,address,uint256,bytes) · 33581 · 90586 · 71466 · 270 · 11.92 │ +| KnownOriginDigitalAssetV3 · safeTransferFrom(address,address,uint256,bytes) · 33625 · 90618 · 71499 · 270 · 17.31 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · safeTransferFrom(address,address,uint256) · 32803 · 89366 · 70555 · 271 · 11.76 │ +| KnownOriginDigitalAssetV3 · safeTransferFrom(address,address,uint256) · 32803 · 89354 · 70545 · 271 · 17.08 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · setApprovalForAll(address,bool) · 14550 · 46236 · 44654 · 1091 · 7.45 │ +| KnownOriginDigitalAssetV3 · setApprovalForAll(address,bool) · 14529 · 46169 · 44582 · 1112 · 10.80 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · setRoyaltiesRegistryProxy(address) · 53174 · 53186 · 53184 · 5 · 8.87 │ +| KnownOriginDigitalAssetV3 · setRoyaltiesRegistryProxy(address) · - · - · 53099 · 5 · 12.86 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · setTokenUriResolver(address) · 20804 · 53144 · 46676 · 5 · 7.78 │ +| KnownOriginDigitalAssetV3 · setTokenUriResolver(address) · 20804 · 53144 · 47754 · 6 · 11.56 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · toggleEditionSalesDisabled(uint256) · 23975 · 56075 · 47489 · 13 · 7.92 │ +| KnownOriginDigitalAssetV3 · toggleEditionSalesDisabled(uint256) · 23943 · 56043 · 47502 · 14 · 11.50 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · transferERC20(uint256,address,address,uint256) · 57380 · 129414 · 105009 · 15 · 17.51 │ +| KnownOriginDigitalAssetV3 · transferChild(uint256,address) · - · - · 44608 · 2 · 10.80 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · transferFrom(address,address,uint256) · 27996 · 82105 · 65500 · 199 · 10.92 │ +| KnownOriginDigitalAssetV3 · transferERC20(uint256,address,address,uint256) · 57405 · 129446 · 104995 · 15 · 25.43 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · updateSecondaryRoyalty(uint256) · 20572 · 35608 · 28090 · 2 · 4.68 │ +| KnownOriginDigitalAssetV3 · transferFrom(address,address,uint256) · 27996 · 82093 · 65487 · 200 · 15.86 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · updateURIIfNoSaleMade(uint256,string) · - · - · 35147 · 1 · 5.86 │ +| KnownOriginDigitalAssetV3 · updateSecondaryRoyalty(uint256) · 20572 · 35608 · 28090 · 2 · 6.80 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · withdrawStuckTokens(address,uint256,address) · - · - · 48628 · 1 · 8.11 │ +| KnownOriginDigitalAssetV3 · updateURIIfNoSaleMade(uint256,string) · - · - · 37367 · 1 · 9.05 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · addAdminRole(address) · - · - · 48803 · 2 · 8.14 │ +| KnownOriginDigitalAssetV3 · withdrawStuckTokens(address,uint256,address) · - · - · 48564 · 1 · 11.76 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · addContractRole(address) · - · - · 48770 · 2 · 8.13 │ +| KOAccessControls · addAdminRole(address) · - · - · 48803 · 2 · 11.82 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · grantRole(bytes32,address) · 51051 · 51435 · 51411 · 3317 · 8.57 │ +| KOAccessControls · addContractRole(address) · - · - · 48770 · 2 · 11.81 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · removeAdminRole(address) · - · - · 19123 · 2 · 3.19 │ +| KOAccessControls · grantRole(bytes32,address) · 51051 · 51435 · 51411 · 3392 · 12.45 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · removeContractRole(address) · - · - · 19158 · 2 · 3.19 │ +| KOAccessControls · removeAdminRole(address) · - · - · 19123 · 2 · 4.63 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · setVerifiedArtistProxy(address,uint256,bytes32[]) · 48699 · 50507 · 49080 · 19 · 8.18 │ +| KOAccessControls · removeContractRole(address) · - · - · 19158 · 2 · 4.64 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · updateArtistMerkleRoot(bytes32) · 29855 · 47303 · 47252 · 344 · 7.88 │ +| KOAccessControls · setVerifiedArtistProxy(address,uint256,bytes32[]) · 48699 · 50507 · 49101 · 18 · 11.89 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KOAccessControls · updateArtistMerkleRootIpfsHash(string) · - · - · 48598 · 1 · 8.10 │ +| KOAccessControls · updateArtistMerkleRoot(bytes32) · 29855 · 47303 · 47254 · 354 · 11.44 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · acceptEditionBid(uint256,uint256) · 87556 · 110783 · 99706 · 11 · 16.62 │ +| KOAccessControls · updateArtistMerkleRootIpfsHash(string) · - · - · 48598 · 1 · 11.77 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · adminRejectEditionBid(uint256) · - · - · 29360 · 4 · 4.90 │ +| KODAV3PrimaryMarketplace · acceptEditionBid(uint256,uint256) · 87587 · 110814 · 99737 · 11 · 24.15 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · buyEditionToken(uint256) · 117823 · 144627 · 132619 · 76 · 22.11 │ +| KODAV3PrimaryMarketplace · adminRejectEditionBid(uint256) · - · - · 31996 · 4 · 7.75 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · buyEditionTokenFor(uint256,address) · 135192 · 139828 · 137556 · 4 · 22.93 │ +| KODAV3PrimaryMarketplace · buyEditionToken(uint256) · 117832 · 144590 · 132627 · 76 · 32.12 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · buyNextStep(uint256) · 140670 · 147641 · 142726 · 18 · 23.80 │ +| KODAV3PrimaryMarketplace · buyEditionTokenFor(uint256,address) · 135223 · 139859 · 137587 · 4 · 33.32 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertFromBuyNowToOffers(uint256,uint128) · 28979 · 34113 · 30263 · 4 · 5.05 │ +| KODAV3PrimaryMarketplace · buyNextStep(uint256) · 140773 · 147744 · 142829 · 18 · 34.59 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertOffersToBuyItNow(uint256,uint128,uint128) · 71921 · 96517 · 82988 · 5 · 13.84 │ +| KODAV3PrimaryMarketplace · buyNextStepFor(uint256,address) · 143707 · 150678 · 145852 · 14 · 35.32 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertReserveAuctionToBuyItNow(uint256,uint128,uint128) · 60066 · 60221 · 60144 · 2 · 10.03 │ +| KODAV3PrimaryMarketplace · convertFromBuyNowToOffers(uint256,uint128) · 28946 · 34047 · 30221 · 4 · 7.32 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertReserveAuctionToOffers(uint256,uint128) · 35062 · 41358 · 38210 · 2 · 6.37 │ +| KODAV3PrimaryMarketplace · convertOffersToBuyItNow(uint256,uint128,uint128) · 71944 · 96539 · 83010 · 5 · 20.10 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertSteppedAuctionToListing(uint256,uint128,uint128) · 46607 · 51494 · 47829 · 4 · 7.97 │ +| KODAV3PrimaryMarketplace · convertReserveAuctionToBuyItNow(uint256,uint128,uint128) · 60067 · 60221 · 60144 · 2 · 14.57 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · convertSteppedAuctionToOffers(uint256,uint128) · 21491 · 24533 · 23012 · 2 · 3.84 │ +| KODAV3PrimaryMarketplace · convertReserveAuctionToOffers(uint256,uint128) · 35084 · 41370 · 38227 · 2 · 9.26 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · emergencyExitBidFromReserveAuction(uint256) · 34676 · 43512 · 39251 · 10 · 6.54 │ +| KODAV3PrimaryMarketplace · convertSteppedAuctionToListing(uint256,uint128,uint128) · 46607 · 51494 · 47829 · 4 · 11.58 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · enableEditionOffers(uint256,uint128) · 33650 · 53598 · 47899 · 7 · 7.99 │ +| KODAV3PrimaryMarketplace · convertSteppedAuctionToOffers(uint256,uint128) · 21497 · 24539 · 23018 · 2 · 5.57 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · listForBuyNow(address,uint256,uint128,uint128) · 84128 · 84188 · 84184 · 50 · 14.04 │ +| KODAV3PrimaryMarketplace · emergencyExitBidFromReserveAuction(uint256) · 34682 · 43512 · 39254 · 10 · 9.51 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · listForReserveAuction(address,uint256,uint128,uint128) · 96085 · 116045 · 96496 · 50 · 16.09 │ +| KODAV3PrimaryMarketplace · enableEditionOffers(uint256,uint128) · 33672 · 53620 · 47921 · 7 · 11.61 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · listSteppedEditionAuction(address,uint256,uint128,uint128,uint128) · 82115 · 102063 · 100116 · 41 · 16.69 │ +| KODAV3PrimaryMarketplace · listForBuyNow(address,uint256,uint128,uint128) · 84150 · 84210 · 84206 · 50 · 20.39 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · pause() · - · - · 33561 · 1 · 5.60 │ +| KODAV3PrimaryMarketplace · listForReserveAuction(address,uint256,uint128,uint128) · 96106 · 116066 · 96501 · 52 · 23.37 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · placeBidOnReserveAuction(uint256) · 60590 · 85737 · 80158 · 33 · 13.36 │ +| KODAV3PrimaryMarketplace · listSteppedEditionAuction(address,uint256,uint128,uint128,uint128) · 82049 · 101997 · 100644 · 59 · 24.37 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · placeEditionBid(uint256) · 63169 · 107766 · 103362 · 54 · 17.23 │ +| KODAV3PrimaryMarketplace · pause() · - · - · 33583 · 1 · 8.13 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · recoverERC20(address,address,uint256) · - · - · 50467 · 1 · 8.41 │ +| KODAV3PrimaryMarketplace · placeBidOnReserveAuction(uint256) · 60526 · 85683 · 79170 · 36 · 19.17 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · recoverStuckETH(address,uint256) · - · - · 40885 · 1 · 6.82 │ +| KODAV3PrimaryMarketplace · placeBidOnReserveAuctionFor(uint256,address) · - · - · 86139 · 1 · 20.86 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · rejectEditionBid(uint256) · 32926 · 35899 · 33422 · 6 · 5.57 │ +| KODAV3PrimaryMarketplace · placeEditionBid(uint256) · 63179 · 107776 · 103372 · 54 · 25.03 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · resultReserveAuction(uint256) · 76932 · 93564 · 89238 · 5 · 14.88 │ +| KODAV3PrimaryMarketplace · placeEditionBidFor(uint256,address) · - · - · 108274 · 3 · 26.22 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · setBuyNowPriceListing(uint256,uint128) · 32760 · 38916 · 35838 · 2 · 5.98 │ +| KODAV3PrimaryMarketplace · recoverERC20(address,address,uint256) · - · - · 50391 · 1 · 12.20 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · setKoCommissionOverrideForCreator(address,bool,uint256) · 56107 · 76043 · 72049 · 5 · 12.01 │ +| KODAV3PrimaryMarketplace · recoverStuckETH(address,uint256) · - · - · 40935 · 1 · 9.91 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · setKoCommissionOverrideForEdition(uint256,bool,uint256) · - · - · 75689 · 2 · 12.62 │ +| KODAV3PrimaryMarketplace · rejectEditionBid(uint256) · 32938 · 35910 · 33363 · 7 · 8.08 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · unpause() · - · - · 33542 · 1 · 5.59 │ +| KODAV3PrimaryMarketplace · resultReserveAuction(uint256) · 76937 · 93573 · 87194 · 6 · 21.12 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateAccessControls(address) · - · - · 40399 · 1 · 6.74 │ +| KODAV3PrimaryMarketplace · setBuyNowPriceListing(uint256,uint128) · 32782 · 38938 · 35860 · 2 · 8.68 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateBidLockupPeriod(uint256) · - · - · 35677 · 1 · 5.95 │ +| KODAV3PrimaryMarketplace · setKoCommissionOverrideForCreator(address,bool,uint256) · 56107 · 76043 · 72049 · 5 · 17.45 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateMinBidAmount(uint256) · - · - · 35644 · 1 · 5.94 │ +| KODAV3PrimaryMarketplace · setKoCommissionOverrideForEdition(uint256,bool,uint256) · - · - · 75689 · 2 · 18.33 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateModulo(uint256) · - · - · 35628 · 1 · 5.94 │ +| KODAV3PrimaryMarketplace · unpause() · - · - · 33564 · 1 · 8.13 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updatePlatformAccount(address) · - · - · 36525 · 1 · 6.09 │ +| KODAV3PrimaryMarketplace · updateAccessControls(address) · - · - · 40411 · 1 · 9.79 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updatePlatformPrimarySaleCommission(uint256) · - · - · 35662 · 1 · 5.95 │ +| KODAV3PrimaryMarketplace · updateBidLockupPeriod(uint256) · - · - · 35699 · 1 · 8.65 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateReserveAuctionBidExtensionWindow(uint128) · - · - · 35773 · 1 · 5.96 │ +| KODAV3PrimaryMarketplace · updateMinBidAmount(uint256) · - · - · 35666 · 1 · 8.64 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateReserveAuctionLengthOnceReserveMet(uint128) · - · - · 35778 · 1 · 5.97 │ +| KODAV3PrimaryMarketplace · updateModulo(uint256) · - · - · 35651 · 1 · 8.63 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateReservePriceForReserveAuction(uint256,uint128) · 39506 · 45584 · 42545 · 2 · 7.09 │ +| KODAV3PrimaryMarketplace · updatePlatformAccount(address) · - · - · 36525 · 1 · 8.85 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · updateSteppedAuction(uint256,uint128,uint128) · 35594 · 41675 · 38635 · 2 · 6.44 │ +| KODAV3PrimaryMarketplace · updatePlatformPrimarySaleCommission(uint256) · - · - · 35662 · 1 · 8.64 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · withdrawBidFromReserveAuction(uint256) · - · - · 32765 · 1 · 5.46 │ +| KODAV3PrimaryMarketplace · updateReserveAuctionBidExtensionWindow(uint128) · - · - · 35773 · 1 · 8.66 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · withdrawEditionBid(uint256) · - · - · 27578 · 6 · 4.60 │ +| KODAV3PrimaryMarketplace · updateReserveAuctionLengthOnceReserveMet(uint128) · - · - · 35778 · 1 · 8.66 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · acceptEditionBid(uint256,uint256) · - · - · 112991 · 1 · 18.84 │ +| KODAV3PrimaryMarketplace · updateReservePriceForReserveAuction(uint256,uint128) · 39495 · 45573 · 42534 · 2 · 10.30 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · acceptTokenBid(uint256,uint256) · 84319 · 107358 · 98142 · 5 · 16.36 │ +| KODAV3PrimaryMarketplace · updateSteppedAuction(uint256,uint128,uint128) · 35594 · 41675 · 38635 · 2 · 9.36 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · adminRejectTokenBid(uint256) · - · - · 37358 · 4 · 6.23 │ +| KODAV3PrimaryMarketplace · withdrawBidFromReserveAuction(uint256) · - · - · 32766 · 1 · 7.93 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · buyEditionToken(uint256) · 91844 · 139177 · 114197 · 5 · 19.04 │ +| KODAV3PrimaryMarketplace · withdrawEditionBid(uint256) · - · - · 27576 · 7 · 6.68 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · buyEditionTokenFor(uint256,address) · 92300 · 111900 · 99667 · 3 · 16.62 │ +| KODAV3SecondaryMarketplace · acceptEditionBid(uint256,uint256) · - · - · 113000 · 1 · 27.37 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · convertReserveAuctionToBuyItNow(uint256,uint128,uint128) · 60066 · 60221 · 60144 · 2 · 10.03 │ +| KODAV3SecondaryMarketplace · acceptTokenBid(uint256,uint256) · 84318 · 107356 · 98141 · 5 · 23.77 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · convertReserveAuctionToOffers(uint256) · 22529 · 29959 · 26244 · 2 · 4.38 │ +| KODAV3SecondaryMarketplace · adminRejectTokenBid(uint256) · - · - · 37362 · 4 · 9.05 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · delistToken(uint256) · - · - · 21638 · 1 · 3.61 │ +| KODAV3SecondaryMarketplace · buyEditionToken(uint256) · 91822 · 139143 · 114170 · 5 · 27.65 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · emergencyExitBidFromReserveAuction(uint256) · 34617 · 41774 · 38220 · 4 · 6.37 │ +| KODAV3SecondaryMarketplace · buyEditionTokenFor(uint256,address) · 92322 · 111922 · 99689 · 3 · 24.14 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · listForBuyNow(address,uint256,uint128,uint128) · - · - · 86651 · 1 · 14.45 │ +| KODAV3SecondaryMarketplace · convertReserveAuctionToBuyItNow(uint256,uint128,uint128) · 60045 · 60199 · 60122 · 2 · 14.56 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · listForReserveAuction(address,uint256,uint128,uint128) · 90959 · 110919 · 91414 · 45 · 15.24 │ +| KODAV3SecondaryMarketplace · convertReserveAuctionToOffers(uint256) · 22540 · 29971 · 26256 · 2 · 6.36 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · listTokenForBuyNow(uint256,uint128,uint128) · 83777 · 83825 · 83820 · 20 · 13.98 │ +| KODAV3SecondaryMarketplace · delistToken(uint256) · - · - · 21649 · 1 · 5.24 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · pause() · - · - · 33597 · 1 · 5.60 │ +| KODAV3SecondaryMarketplace · emergencyExitBidFromReserveAuction(uint256) · 34623 · 41780 · 38226 · 4 · 9.26 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · placeBidOnReserveAuction(uint256) · 60664 · 85811 · 78835 · 26 · 13.14 │ +| KODAV3SecondaryMarketplace · listForBuyNow(address,uint256,uint128,uint128) · - · - · 86683 · 1 · 20.99 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · placeEditionBid(uint256) · - · - · 106829 · 8 · 17.81 │ +| KODAV3SecondaryMarketplace · listForReserveAuction(address,uint256,uint128,uint128) · 90991 · 110951 · 91436 · 46 · 22.14 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · placeTokenBid(uint256) · 75125 · 114411 · 110386 · 41 · 18.40 │ +| KODAV3SecondaryMarketplace · listTokenForBuyNow(uint256,uint128,uint128) · 83821 · 83869 · 83864 · 20 · 20.31 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · rejectTokenBid(uint256) · - · - · 34479 · 4 · 5.75 │ +| KODAV3SecondaryMarketplace · pause() · - · - · 33488 · 1 · 8.11 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · resultReserveAuction(uint256) · 80432 · 97932 · 93432 · 5 · 15.58 │ +| KODAV3SecondaryMarketplace · placeBidOnReserveAuction(uint256) · 60493 · 85650 · 78000 · 27 · 18.89 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · unpause() · - · - · 33468 · 1 · 5.58 │ +| KODAV3SecondaryMarketplace · placeBidOnReserveAuctionFor(uint256,address) · - · - · 86170 · 1 · 20.87 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · updatePlatformSecondarySaleCommission(uint256) · - · - · 35566 · 1 · 5.93 │ +| KODAV3SecondaryMarketplace · placeEditionBid(uint256) · - · - · 106717 · 8 · 25.84 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · updateReserveAuctionBidExtensionWindow(uint128) · - · - · 35655 · 1 · 5.94 │ +| KODAV3SecondaryMarketplace · placeEditionBidFor(uint256,address) · - · - · 107238 · 1 · 25.97 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · updateReserveAuctionLengthOnceReserveMet(uint128) · - · - · 35683 · 1 · 5.95 │ +| KODAV3SecondaryMarketplace · placeTokenBid(uint256) · 75167 · 114463 · 110437 · 41 · 26.74 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · updateReservePriceForReserveAuction(uint256,uint128) · 39528 · 61963 · 50746 · 2 · 8.46 │ +| KODAV3SecondaryMarketplace · placeTokenBidFor(uint256,address) · - · - · 114894 · 3 · 27.82 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · withdrawBidFromReserveAuction(uint256) · - · - · 32765 · 1 · 5.46 │ +| KODAV3SecondaryMarketplace · rejectTokenBid(uint256) · - · - · 34429 · 5 · 8.34 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · withdrawEditionBid(uint256) · - · - · 27543 · 1 · 4.59 │ +| KODAV3SecondaryMarketplace · resultReserveAuction(uint256) · 80420 · 97920 · 91253 · 6 · 22.10 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · withdrawTokenBid(uint256) · - · - · 27548 · 7 · 4.59 │ +| KODAV3SecondaryMarketplace · unpause() · - · - · 33490 · 1 · 8.11 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockERC20 · approve(address,uint256) · 26279 · 46263 · 40990 · 34 · 6.83 │ +| KODAV3SecondaryMarketplace · updatePlatformSecondarySaleCommission(uint256) · - · - · 35589 · 1 · 8.62 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockERC20 · transfer(address,uint256) · 51601 · 51661 · 51659 · 29 · 8.61 │ +| KODAV3SecondaryMarketplace · updateReserveAuctionBidExtensionWindow(uint128) · - · - · 35678 · 1 · 8.64 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintBatchEdition(uint8,uint96,uint128,uint128,uint128,string,uint256,bytes32[],address) · 245174 · 319779 · 291690 · 14 · 48.63 │ +| KODAV3SecondaryMarketplace · updateReserveAuctionLengthOnceReserveMet(uint128) · - · - · 35728 · 1 · 8.65 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintBatchEditionAndComposeERC20s(uint8,uint128[],string,address[],uint256[],bytes32[]) · 387991 · 388003 · 387997 · 2 · 64.69 │ +| KODAV3SecondaryMarketplace · updateReservePriceForReserveAuction(uint256,uint128) · 39551 · 61986 · 50769 · 2 · 12.29 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintBatchEditionAndComposeERC20sAsProxy(address,uint8,uint128[],string,address[],uint256[]) · - · - · 387886 · 1 · 64.67 │ +| KODAV3SecondaryMarketplace · withdrawBidFromReserveAuction(uint256) · - · - · 32744 · 1 · 7.93 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintBatchEditionAsProxy(address,uint8,uint96,uint128,uint128,uint128,string,address) · - · - · 279161 · 2 · 46.54 │ +| KODAV3SecondaryMarketplace · withdrawEditionBid(uint256) · - · - · 27544 · 1 · 6.67 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintConsecutiveBatchEdition(uint8,uint96,uint128,uint128,uint128,string,uint256,bytes32[],address) · 226468 · 260401 · 251918 · 8 · 42.00 │ +| KODAV3SecondaryMarketplace · withdrawTokenBid(uint256) · - · - · 27538 · 8 · 6.67 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintConsecutiveBatchEditionAsProxy(address,uint8,uint96,uint128,uint128,uint128,string,address) · - · - · 260510 · 2 · 43.44 │ +| MockERC20 · approve(address,uint256) · 26279 · 46263 · 40990 · 34 · 9.93 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintToken(uint8,uint128,uint128,uint128,string,uint256,bytes32[],address) · 225367 · 260412 · 228061 · 138 · 38.02 │ +| MockERC20 · transfer(address,uint256) · 51537 · 51597 · 51595 · 29 · 12.49 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · mintTokenAsProxy(address,uint8,uint128,uint128,uint128,string,address) · - · - · 260153 · 2 · 43.38 │ +| MockMintingFactory · mintBatchEdition(uint8,uint16,uint128,uint128,uint128,string,uint256,bytes32[],address) · 245218 · 319822 · 291732 · 14 · 70.65 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · setFrequencyOverride(address,bool) · 21487 · 53599 · 37543 · 2 · 6.26 │ +| MockMintingFactory · mintBatchEditionAndComposeERC20s(uint8,uint128[],string,address[],uint256[],bytes32[]) · - · - · 387868 · 2 · 93.93 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · setMaxMintsInPeriod(uint256) · - · - · 35581 · 2 · 5.93 │ +| MockMintingFactory · mintBatchEditionAndComposeERC20sAsProxy(address,uint8,uint128[],string,address[],uint256[]) · - · - · 387785 · 1 · 93.91 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · setMintingPeriod(uint256) · - · - · 35493 · 3 · 5.92 │ +| MockMintingFactory · mintBatchEditionAsProxy(address,uint8,uint16,uint128,uint128,uint128,string,address) · - · - · 279086 · 2 · 67.59 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · setNow(uint128) · 26689 · 43789 · 38089 · 3 · 6.35 │ +| MockMintingFactory · mintConsecutiveBatchEdition(uint8,uint16,uint128,uint128,uint128,string,uint256,bytes32[],address) · 226467 · 260400 · 251917 · 8 · 61.01 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · setRoyaltiesRegistry(address) · 53016 · 53028 · 53024 · 3 · 8.84 │ +| MockMintingFactory · mintConsecutiveBatchEditionAsProxy(address,uint8,uint16,uint128,uint128,uint128,string,address) · - · - · 260499 · 2 · 63.09 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockRoyaltiesRegistry · setupRoyalty(uint256,address,uint256) · - · - · 66475 · 1 · 11.08 │ +| MockMintingFactory · mintToken(uint8,uint128,uint128,uint128,string,uint256,bytes32[],address) · 225346 · 260391 · 228040 · 138 · 55.22 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| MockTokenUriResolver · setEditionUri(uint256,string) · - · - · 44931 · 2 · 7.49 │ +| MockMintingFactory · mintTokenAsProxy(address,uint8,uint128,uint128,uint128,string,address) · - · - · 260176 · 2 · 63.01 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| RoyaltyBeacon · upgradeTo(address) · 32687 · 32699 · 32696 · 4 · 5.45 │ +| MockMintingFactory · setFrequencyOverride(address,bool) · 21465 · 53577 · 37521 · 2 · 9.09 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV1R1 · init(address[],uint256[]) · - · - · 206867 · 2 · 34.49 │ +| MockMintingFactory · setMaxMintsInPeriod(uint256) · - · - · 35581 · 2 · 8.62 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV1R2 · init(address[],uint256[]) · - · - · 206867 · 3 · 34.49 │ +| MockMintingFactory · setMintingPeriod(uint256) · - · - · 35493 · 3 · 8.60 │ ·······························|······································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV2 · init(address[],uint256[]) · - · - · 223965 · 3 · 37.34 │ +| MockMintingFactory · setNow(uint128) · 26689 · 43789 · 38089 · 3 · 9.22 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockMintingFactory · setRoyaltiesRegistry(address) · - · - · 53028 · 3 · 12.84 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockNFT · approve(address,uint256) · - · - · 48722 · 6 · 11.80 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockNFT · mint(address,uint256) · - · - · 68658 · 23 · 16.63 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockNFT · transferFrom(address,address,uint256) · - · - · 47409 · 1 · 11.48 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockRoyaltiesRegistry · setupRoyalty(uint256,address,uint256) · - · - · 66475 · 1 · 16.10 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| MockTokenUriResolver · setEditionUri(uint256,string) · - · - · 44931 · 3 · 10.88 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| RoyaltyBeacon · upgradeTo(address) · - · - · 32699 · 4 · 7.92 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| RoyaltyImplV1R1 · init(address[],uint256[]) · - · - · 206867 · 2 · 50.10 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| RoyaltyImplV1R2 · init(address[],uint256[]) · - · - · 206867 · 3 · 50.10 │ +·······························|······································································································|·············|·············|·············|···············|·············· +| RoyaltyImplV2 · init(address[],uint256[]) · - · - · 223965 · 3 · 54.24 │ ·······························|······································································································|·············|·············|·············|···············|·············· | Deployments · · % of limit · │ ······································································································································|·············|·············|·············|···············|·············· -| BeaconBasedRegistry · - · - · 996421 · 8 % · 166.13 │ +| BeaconBasedRegistry · - · - · 996421 · 8 % · 241.30 │ +······································································································································|·············|·············|·············|···············|·············· +| ClaimableFundsReceiverV1 · - · - · 895780 · 7.2 % · 216.93 │ ······································································································································|·············|·············|·············|···············|·············· -| ClaimableFundsReceiverV1 · - · - · 895780 · 7.2 % · 149.35 │ +| CloneBasedRegistry · - · - · 470264 · 3.8 % · 113.88 │ ······································································································································|·············|·············|·············|···············|·············· -| CloneBasedRegistry · - · - · 470264 · 3.8 % · 78.41 │ +| CollabRoyaltiesRegistry · 1754088 · 1754100 · 1754099 · 14.1 % · 424.79 │ ······································································································································|·············|·············|·············|···············|·············· -| CollabRoyaltiesRegistry · 1859900 · 1859912 · 1859911 · 14.9 % · 310.10 │ +| ERC721ReceiverMock · 244555 · 244603 · 244591 · 2 % · 59.23 │ ······································································································································|·············|·············|·············|···············|·············· -| ERC721ReceiverMock · 244555 · 244603 · 244591 · 2 % · 40.78 │ +| FundsReceiver · - · - · 406247 · 3.3 % · 98.38 │ ······································································································································|·············|·············|·············|···············|·············· -| FundsReceiver · - · - · 406247 · 3.3 % · 67.73 │ +| FundsSplitter · - · - · 353062 · 2.8 % · 85.50 │ ······································································································································|·············|·············|·············|···············|·············· -| FundsSplitter · - · - · 353062 · 2.8 % · 58.87 │ +| KnownOriginDigitalAssetV3 · 5590389 · 5610553 · 5590948 · 44.9 % · 1353.96 │ ······································································································································|·············|·············|·············|···············|·············· -| KnownOriginDigitalAssetV3 · 5265142 · 5285330 · 5265750 · 42.3 % · 877.96 │ +| KOAccessControls · 1163742 · 1163766 · 1163765 · 9.3 % · 281.83 │ ······································································································································|·············|·············|·············|···············|·············· -| KOAccessControls · 1163742 · 1163766 · 1163765 · 9.3 % · 194.04 │ +| KODAV3PrimaryMarketplace · 5110367 · 5110403 · 5110394 · 41 % · 1237.59 │ ······································································································································|·············|·············|·············|···············|·············· -| KODAV3PrimaryMarketplace · 5052757 · 5052793 · 5052784 · 40.6 % · 842.46 │ +| KODAV3SecondaryMarketplace · 4319664 · 4319712 · 4319705 · 34.7 % · 1046.11 │ ······································································································································|·············|·············|·············|···············|·············· -| KODAV3SecondaryMarketplace · 4247905 · 4247941 · 4247934 · 34.1 % · 708.26 │ +| MockERC20 · - · - · 637487 · 5.1 % · 154.38 │ ······································································································································|·············|·············|·············|···············|·············· -| MockERC20 · - · - · 647400 · 5.2 % · 107.94 │ +| MockMintingFactory · 2143644 · 2143656 · 2143652 · 17.2 % · 519.13 │ ······································································································································|·············|·············|·············|···············|·············· -| MockMintingFactory · 2145360 · 2145372 · 2145369 · 17.2 % · 357.70 │ +| MockNFT · - · - · 1193748 · 9.6 % · 289.09 │ ······································································································································|·············|·············|·············|···············|·············· -| MockRoyaltiesRegistry · - · - · 246332 · 2 % · 41.07 │ +| MockRoyaltiesRegistry · - · - · 246332 · 2 % · 59.65 │ ······································································································································|·············|·············|·············|···············|·············· -| MockTokenUriResolver · - · - · 266846 · 2.1 % · 44.49 │ +| MockTokenUriResolver · - · - · 266846 · 2.1 % · 64.62 │ ······································································································································|·············|·············|·············|···············|·············· -| RoyaltyBeacon · 315243 · 315267 · 315266 · 2.5 % · 52.56 │ +| RoyaltyBeacon · 302526 · 302538 · 302537 · 2.4 % · 73.27 │ ······································································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV1R1 · - · - · 420719 · 3.4 % · 70.15 │ +| RoyaltyImplV1R1 · - · - · 420719 · 3.4 % · 101.89 │ ······································································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV1R2 · - · - · 406235 · 3.3 % · 67.73 │ +| RoyaltyImplV1R2 · - · - · 406235 · 3.3 % · 98.38 │ ······································································································································|·············|·············|·············|···············|·············· -| RoyaltyImplV2 · - · - · 353062 · 2.8 % · 58.87 │ +| RoyaltyImplV2 · - · - · 353062 · 2.8 % · 85.50 │ ······································································································································|·············|·············|·············|···············|·············· -| SelfServiceAccessControls · - · - · 170307 · 1.4 % · 28.40 │ +| SelfServiceAccessControls · - · - · 170307 · 1.4 % · 41.24 │ ······································································································································|·············|·············|·············|···············|·············· -| SimpleIERC2981 · - · - · 265569 · 2.1 % · 44.28 │ +| SimpleIERC2981 · - · - · 265569 · 2.1 % · 64.31 │ ·-------------------------------------------------------------------------------------------------------------------------------------|-------------|-------------|-------------|---------------|-------------·