From c72ac688c901df6676597eeb1fb0b535d72d83b2 Mon Sep 17 00:00:00 2001 From: six Date: Thu, 24 Aug 2023 10:26:30 +0000 Subject: [PATCH] Vault draft --- contracts/cctf_vault_draft.sol | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 contracts/cctf_vault_draft.sol diff --git a/contracts/cctf_vault_draft.sol b/contracts/cctf_vault_draft.sol new file mode 100644 index 0000000..2d68509 --- /dev/null +++ b/contracts/cctf_vault_draft.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.17; +import "cctf.sol"; + +contract CCTF_Vault { + + address ctf_manager; + + modifier ctf_manager_only { + require(ctf_manager == msg.sender); + _; + } + + constructor() payable { + } + + function deposit() external payable {} + + function pay_winners() external { + // 1. Require that CTF finished + // 2. Check the top players and pay them out (based on what ratios/how?) + + //CryptoCTFX.getPlayerScore(1, address); + } + + function emergency_withdraw() external ctf_manager_only { + (bool success, ) = msg.sender.call{value: address(this).balance}(""); + require(success, "Failed to send Ether"); + } +} \ No newline at end of file