Skip to content

Commit

Permalink
feat: add functions to interface, remove proxy admin deployment from …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
QEDK committed Mar 21, 2024
1 parent 94cbdda commit f118e3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 16 additions & 0 deletions src/interfaces/IAvailBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,20 @@ interface IAvailBridge {
error InvalidMessage();
error UnlockFailed();
error WithdrawFailed();

function setPaused(bool status) external;
// no good way to have this function be in the import, so it's commented out
// function updateVectorx(address newVectorx) external;
function updateTokens(bytes32[] calldata assetIds, address[] calldata tokenAddresses) external;
function updateFeePerByte(uint256 newFeePerByte) external;
function updateFeeRecipient(address newFeeRecipient) external;
function withdrawFees() external;
function receiveMessage(Message calldata message, MerkleProofInput calldata input) external;
function receiveAVAIL(Message calldata message, MerkleProofInput calldata input) external;
function receiveETH(Message calldata message, MerkleProofInput calldata input) external;
function receiveERC20(Message calldata message, MerkleProofInput calldata input) external;
function sendMessage(bytes32 recipient, bytes calldata data) external payable;
function sendAVAIL(bytes32 recipient, uint256 amount) external;
function sendETH(bytes32 recipient) external payable;
function sendERC20(bytes32 assetId, bytes32 recipient, uint256 amount) external;
}
5 changes: 1 addition & 4 deletions test/AvailBridgeTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity ^0.8.25;

import {TransparentUpgradeableProxy} from
"lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {ProxyAdmin} from "lib/openzeppelin-contracts/contracts/proxy/transparent/ProxyAdmin.sol";
import {IAccessControl} from "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol";
import {Pausable} from "lib/openzeppelin-contracts/contracts/utils/Pausable.sol";
import {IAvailBridge, AvailBridge} from "src/AvailBridge.sol";
Expand All @@ -18,19 +17,17 @@ contract AvailBridgeTest is Test, MurkyBase {
AvailBridge public bridge;
Avail public avail;
VectorxMock public vectorx;
ProxyAdmin public admin;
Sha2Merkle public sha2merkle;
address public owner;
address public pauser;
bytes public constant revertCode = "5F5FFD";

function setUp() external {
vectorx = new VectorxMock();
admin = new ProxyAdmin(msg.sender);
pauser = makeAddr("pauser");
sha2merkle = new Sha2Merkle();
address impl = address(new AvailBridge());
bridge = AvailBridge(address(new TransparentUpgradeableProxy(impl, address(admin), "")));
bridge = AvailBridge(address(new TransparentUpgradeableProxy(impl, msg.sender, "")));
avail = new Avail(address(bridge));
bridge.initialize(0, msg.sender, IAvail(address(avail)), msg.sender, pauser, IVectorx(vectorx));
owner = msg.sender;
Expand Down

0 comments on commit f118e3b

Please sign in to comment.