Guard Contract
GateKeeps contracts are audited by hacken.io
The Guard contract acts as a proxy between our secure wallet and the user owned Brink contract. Its only functionality and purpose is to dynamically trigger a Brink contracts intercept functions.
It does not have approval to move your assets, only your Brink contract does. The guard contract can simply trigger the function in the Brink contract in case of a detected theft to move the asset to the user specified safe wallet address in the Brink contract before the thiefs transaction processes.
Guards Code
contract GatekeepGuard is Ownable, AccessControl {
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
constructor() {
_grantRole(ADMIN_ROLE, msg.sender);
}
function grantAdminRole(address newAddress_) external onlyOwner {
_grantRole(ADMIN_ROLE, newAddress_);
}
function trigger721Intercept(address targetGuard, uint256 tokenId, address tokenContract) external onlyRole(ADMIN_ROLE) {
bytes memory payload = abi.encodeWithSignature("intercept721(uint256,address)", tokenId, tokenContract);
(bool success, bytes memory data) = address(targetGuard).call(payload);
require(success, "intercept 721 failed");
}
function trigger1155Intercept(address targetGuard, uint256 tokenId, address tokenContract) external onlyRole(ADMIN_ROLE) {
bytes memory payload = abi.encodeWithSignature("intercept1155(uint256,address)", tokenId, tokenContract);
(bool success, bytes memory data) = address(targetGuard).call(payload);
require(success, "intercept 1155 failed");
}
function trigger20Intercept(address targetGuard, address tokenContract) external onlyRole(ADMIN_ROLE) {
bytes memory payload = abi.encodeWithSignature("intercept20(address)", tokenContract);
(bool success, bytes memory data) = address(targetGuard).call(payload);
require(success, "intercept 20 failed");
}
}
Last updated