mirror of
https://github.com/logos-co/staking.git
synced 2025-01-11 03:06:24 +00:00
74ff357142
Unstaking didn't actually work because it was using `transferFrom()` on the `StakeVault` with the `from` address being the vault itself. This would result in an approval error because the vault isn't creating any approvals to spend its own funds. The solution is to use `transfer` instead and ensuring the return value is checked.
21 lines
630 B
Solidity
21 lines
630 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.19;
|
|
|
|
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
|
|
contract BrokenERC20 is ERC20 {
|
|
constructor() ERC20("Mock SNT", "SNT") {
|
|
_mint(msg.sender, 1_000_000_000_000_000_000);
|
|
}
|
|
|
|
// solhint-disable-next-line no-unused-vars
|
|
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
|
|
return false;
|
|
}
|
|
|
|
// solhint-disable-next-line no-unused-vars
|
|
function transfer(address recipient, uint256 amount) public override returns (bool) {
|
|
return false;
|
|
}
|
|
}
|