Skip to content

Commit

Permalink
🥢 tighten name fetch
Browse files Browse the repository at this point in the history
🥢 tighten name fetch
  • Loading branch information
z0r0z authored Aug 31, 2023
1 parent aba2b80 commit 24b48b4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/KeepToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.4;

/// @notice ERC1155 interface to receive tokens.
/// @author Modified from Solbase (https://github.com/Sol-DAO/solbase/blob/main/src/tokens/ERC1155/ERC1155.sol)
abstract contract ERC1155TokenReceiver {
function onERC1155Received(
address,
Expand All @@ -25,9 +24,8 @@ abstract contract ERC1155TokenReceiver {
}
}

/// @notice Modern, minimalist, and gas-optimized ERC1155 implementation with Compound-style voting and flexible permissioning scheme.
/// @notice ERC1155 token with Governor-style checkpointing, delegation and transfer restriction scheme.
/// @author Modified from ERC1155V (https://github.com/kalidao/ERC1155V/blob/main/src/ERC1155V.sol)
/// @author Modified from Compound (https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol)
abstract contract KeepToken {
/// -----------------------------------------------------------------------
/// Events
Expand Down Expand Up @@ -258,15 +256,17 @@ abstract contract KeepToken {

function name() public pure virtual returns (string memory) {
uint256 n;

/// @solidity memory-safe-assembly
assembly {
n := sub(
calldatasize(),
add(shr(240, calldataload(sub(calldatasize(), 2))), 2)
n := calldataload(
add(
sub(
calldatasize(),
add(shr(240, calldataload(sub(calldatasize(), 2))), 2)
),
2
)
)

n := calldataload(add(n, 2))
}

return string(abi.encodePacked(n));
Expand Down

0 comments on commit 24b48b4

Please sign in to comment.