[solidity]自己写的合约,请帮我审查是否存在安全问题 #400
wolfbrother
started this conversation in
General
Replies: 1 comment 1 reply
-
大佬,你这个合约我倒是部署和调试通过了,但是执行depositErc20Token函数总是报错,Fail with error 'SafeERC20: low-level call failed',用不起来,不知道啥问题。 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
可以存入ETH和erc20token,存入时设置时间参数,到期后可以将ETH或者erc20token返回原地址。
`
//SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract BankLockTest {
address owner;
uint128 counter;
mapping(address => bool) private legalErc20Tokens;
mapping(string => Receipt) private receiptRepo;
mapping(string => bool) private hasReceipt;
struct Receipt {
address customer;
address token;
uint256 amount;
uint256 unlockTime;
bool isEther;
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions