Skip to content

Commit

Permalink
[FEA-1063] remediate Slowmist audit suggestion [N2] (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs authored Oct 23, 2024
1 parent 70e2c22 commit 6a0e83d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 9 deletions.
7 changes: 6 additions & 1 deletion nest/src/proxy/AggregateTokenProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract AggregateTokenProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("AggregateTokenProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion nest/src/proxy/FakeComponentTokenProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract FakeComponentTokenProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("FakeComponentTokenProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion nest/src/proxy/NestStakingProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract NestStakingProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("NestStakingProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion nest/src/proxy/USDTProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract USDTProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("USDTProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion p/src/proxy/PProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract PProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("PProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion plume/src/proxy/FaucetProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract FaucetProxy is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("FaucetProxy");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
9 changes: 7 additions & 2 deletions staking/src/proxy/PlumePreReserveFund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
/**
* @title PlumePreReserveFund
* @author Eugene Y. Q. Shen
* @notice Proxy contract for SBTCStaking
* @notice Proxy contract for ReserveStaking
*/
contract PlumePreReserveFund is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("PlumePreReserveFund");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}
7 changes: 6 additions & 1 deletion staking/src/proxy/PlumePreStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
*/
contract PlumePreStaking is ERC1967Proxy {

/// @notice Indicates a failure because transferring ETH to the proxy is unsupported
error ETHTransferUnsupported();

/// @notice Name of the proxy, used to ensure each named proxy has unique bytecode
bytes32 public constant PROXY_NAME = keccak256("PlumePreStaking");

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }

/// @dev Fallback function to silence compiler warnings
receive() external payable { }
receive() external payable {
revert ETHTransferUnsupported();
}

}

0 comments on commit 6a0e83d

Please sign in to comment.