Skip to content

Commit

Permalink
chore: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTimepunk committed Dec 26, 2023
1 parent cae36fd commit 39b2eb7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ERC1155A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { IERC1155Receiver } from "openzeppelin-contracts/contracts/token/ERC1155
/// @dev Single/range based id approve capability with conversion to ERC20s
/// @author Zeropoint Labs
abstract contract ERC1155A is IERC1155A, IERC1155Errors {

//////////////////////////////////////////////////////////////
// CONSTANTS //
//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -96,7 +95,7 @@ abstract contract ERC1155A is IERC1155A, IERC1155Errors {
function getERC20TokenAddress(uint256 id) external view virtual override returns (address) {
return aErc20TokenId[id];
}

// Metadata and Interface Support
// ------------------------------

Expand Down Expand Up @@ -145,7 +144,7 @@ abstract contract ERC1155A is IERC1155A, IERC1155Errors {
// Allowance Modification
// -----------------------

/// @inheritdoc IERC1155A
/// @inheritdoc IERC1155A
function increaseAllowance(address operator, uint256 id, uint256 addedValue) public virtual returns (bool) {
_setAllowance(msg.sender, operator, id, allowance(msg.sender, operator, id) + addedValue, true);
return true;
Expand Down Expand Up @@ -288,7 +287,7 @@ abstract contract ERC1155A is IERC1155A, IERC1155Errors {
if (aERC20Token == address(0)) revert AERC20_NOT_REGISTERED();

IaERC20(aERC20Token).mint(receiver, amount);
emit TransmutedToERC20(owner, id, amount,receiver);
emit TransmutedToERC20(owner, id, amount, receiver);
}

/// @inheritdoc IERC1155A
Expand Down Expand Up @@ -330,7 +329,7 @@ abstract contract ERC1155A is IERC1155A, IERC1155Errors {
IaERC20(aERC20Token).mint(receiver, amounts[i]);
}

emit TransmutedBatchToERC20(owner, ids, amounts,receiver);
emit TransmutedBatchToERC20(owner, ids, amounts, receiver);
}

/// @inheritdoc IERC1155A
Expand Down Expand Up @@ -435,6 +434,8 @@ abstract contract ERC1155A is IERC1155A, IERC1155Errors {
/// @dev Implementation copied from solmate/ERC1155 and adapted with operator logic
function _burn(address from, address operator, uint256 id, uint256 amount) internal virtual {
// Check if the msg.sender is the owner or is approved for all tokens
/// Most implementations of _burn don't use allowance, but it is a good practice to check for it
/// Otherwise it could allow to burn tokens on which no explicit allowance is given
if (operator != from && !isApprovedForAll[from][operator]) {
_decreaseAllowance(from, operator, id, amount, false);
}
Expand Down

0 comments on commit 39b2eb7

Please sign in to comment.