mirror of
https://github.com/logos-co/staking.git
synced 2025-01-11 19:24:27 +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
765 B
Solidity
21 lines
765 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.19;
|
|
|
|
import { BaseScript } from "../../script/Base.s.sol";
|
|
import { StakeManager } from "../../contracts/StakeManager.sol";
|
|
import { VaultFactory } from "../../contracts/VaultFactory.sol";
|
|
import { BrokenERC20 } from "../mocks/BrokenERC20.s.sol";
|
|
|
|
contract DeployBroken is BaseScript {
|
|
function run() public returns (VaultFactory, StakeManager, address) {
|
|
BrokenERC20 token = new BrokenERC20();
|
|
|
|
vm.startBroadcast(broadcaster);
|
|
StakeManager stakeManager = new StakeManager(address(token), address(0));
|
|
VaultFactory vaultFactory = new VaultFactory(address(stakeManager));
|
|
vm.stopBroadcast();
|
|
|
|
return (vaultFactory, stakeManager, address(token));
|
|
}
|
|
}
|