-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity 0.8.19; | ||
|
||
import "forge-std/StdUtils.sol"; | ||
import "forge-std/StdCheats.sol"; | ||
import {CommonBase} from "forge-std/Base.sol"; | ||
import {FvmAddress} from "../../../src/structs/FvmAddress.sol"; | ||
import {SubnetID} from "../../../src/structs/Subnet.sol"; | ||
import {GatewayDiamond} from "../../../src/GatewayDiamond.sol"; | ||
import {GatewayManagerFacet} from "../../../src/gateway/GatewayManagerFacet.sol"; | ||
import {EnumerableSet} from "openzeppelin-contracts/utils/structs/EnumerableSet.sol"; | ||
|
||
uint256 constant ETH_SUPPLY = 129_590_000 ether; | ||
|
||
contract GatewayActorFacade is CommonBase, StdCheats, StdUtils { | ||
GatewayManagerFacet managerFacet; | ||
|
||
uint256 private constant DEFAULT_MIN_VALIDATOR_STAKE = 10 ether; | ||
|
||
constructor(GatewayDiamond _gw) { | ||
managerFacet = GatewayManagerFacet(address(_gw)); | ||
|
||
deal(address(this), ETH_SUPPLY); | ||
} | ||
|
||
function register(uint256 amount) external payable { | ||
managerFacet.register(amount); | ||
} | ||
|
||
function addStake() external payable { | ||
managerFacet.addStake(); | ||
} | ||
|
||
function releaseStake(uint256 amount) external { | ||
managerFacet.releaseStake(amount); | ||
} | ||
|
||
function kill() external { | ||
managerFacet.kill(); | ||
} | ||
|
||
function fund(SubnetID calldata subnetId, FvmAddress calldata to) external payable { | ||
managerFacet.fund(subnetId, to); | ||
} | ||
|
||
function fundWithToken(SubnetID calldata subnetId, FvmAddress calldata to, uint256 amount) external { | ||
managerFacet.fundWithToken(subnetId, to, amount); | ||
} | ||
|
||
function release(FvmAddress calldata to) external payable { | ||
managerFacet.release(to); | ||
} | ||
|
||
function forward(address callee, bytes calldata _data) public { | ||
callee.delegatecall(_data); | ||
} | ||
|
||
receive() external payable {} | ||
} |