Skip to content

Commit

Permalink
feat: adding isValidSignature method scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed May 16, 2024
1 parent 51cac69 commit b13a09a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/contracts/BPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ pragma solidity 0.8.23;
import './BMath.sol';
import './BToken.sol';
import 'interfaces/IBFactory.sol';
import {IERC1271} from 'interfaces/IERC1271.sol';

contract BPool is BBronze, BToken, BMath {
contract BPool is IERC1271, BBronze, BToken, BMath {
struct Record {
bool bound; // is token bound to pool
uint256 index; // internal
Expand Down Expand Up @@ -549,4 +550,8 @@ contract BPool is BBronze, BToken, BMath {
IERC20(_tokens[i]).approve(_target, type(uint256).max);
}
}

function isValidSignature(bytes32, bytes memory) external pure override returns (bytes4 magicValue) {
return this.isValidSignature.selector;
}
}
17 changes: 17 additions & 0 deletions src/interfaces/IERC1271.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)

pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC-1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*/
interface IERC1271 {
/**
* @dev Should return whether the signature provided is valid for the provided data
* @param hash Hash of the data to be signed
* @param signature Signature byte array associated with _data
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

0 comments on commit b13a09a

Please sign in to comment.