diff --git a/frontend/abi.js b/frontend/abi.js index c703f66..9aa31b1 100644 --- a/frontend/abi.js +++ b/frontend/abi.js @@ -1,798 +1,356 @@ -myABI = [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_volMaxPoints", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_powDiff", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "CCTFStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "flagId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "flagSigner", - "type": "address" - } - ], - "name": "FlagAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "flagId", - "type": "uint256" - } - ], - "name": "FlagRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "flagId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "solver", - "type": "address" - } - ], - "name": "FlagSolved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "player", - "type": "address" - }, - { - "indexed": false, - "internalType": "enum CCTF9.PlayerStatus", - "name": "newStatus", - "type": "uint8" - } - ], - "name": "PlayerStatusChanged", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_message", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_submitFor", - "type": "uint256" - } - ], - "name": "SubmitFlag", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "TIME_DECAY_MAX", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "endTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "flagCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "flagList", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "flags", - "outputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "enum CCTF9.FlagType", - "name": "flagType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "solveCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentPoints", - "type": "uint256" - }, - { - "internalType": "string", - "name": "skill_name", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_idx", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_count", - "type": "uint256" - } - ], - "name": "getFlags", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "enum CCTF9.FlagType", - "name": "flagType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "solveCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentPoints", - "type": "uint256" - }, - { - "internalType": "string", - "name": "skill_name", - "type": "string" - } - ], - "internalType": "struct CCTF9.Flag[]", - "name": "flagListRet", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getFlags", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "enum CCTF9.FlagType", - "name": "flagType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "solveCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentPoints", - "type": "uint256" - }, - { - "internalType": "string", - "name": "skill_name", - "type": "string" - } - ], - "internalType": "struct CCTF9.Flag[]", - "name": "flagListRet", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_player", - "type": "address" - } - ], - "name": "getPlayerPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_player", - "type": "address" - } - ], - "name": "getPlayerStatus", - "outputs": [ - { - "internalType": "enum CCTF9.PlayerStatus", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_idx", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_count", - "type": "uint256" - } - ], - "name": "getPlayers", - "outputs": [ - { - "components": [ - { - "internalType": "enum CCTF9.PlayerStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "uint256[2][]", - "name": "pointsPerFlag", - "type": "uint256[2][]" - } - ], - "internalType": "struct CCTF9.Player[]", - "name": "playerListRet", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPlayers", - "outputs": [ - { - "components": [ - { - "internalType": "enum CCTF9.PlayerStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "uint256[2][]", - "name": "pointsPerFlag", - "type": "uint256[2][]" - } - ], - "internalType": "struct CCTF9.Player[]", - "name": "playerListRet", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSuccessfulSubmissionCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "playerCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "playerList", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "players", - "outputs": [ - { - "internalType": "enum CCTF9.PlayerStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "points", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "powDiff", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_ethSignedMessageHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "_signature", - "type": "bytes" - } - ], - "name": "recoverSigner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_RTFM", - "type": "string" - }, - { - "internalType": "string", - "name": "_name", - "type": "string" - } - ], - "name": "register", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_admin", - "type": "address" - } - ], - "name": "setAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_endTime", - "type": "uint256" - } - ], - "name": "setCCTFEndTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_paused", - "type": "bool" - } - ], - "name": "setCCTFPaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_startTime", - "type": "uint256" - } - ], - "name": "setCCTFStartTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_flagId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_flagSigner", - "type": "address" - }, - { - "internalType": "enum CCTF9.FlagType", - "name": "_flagType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "_points", - "type": "uint256" - }, - { - "internalType": "string", - "name": "_skill", - "type": "string" - } - ], - "name": "setFlag", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "player", - "type": "address" - }, - { - "internalType": "enum CCTF9.PlayerStatus", - "name": "status", - "type": "uint8" - } - ], - "name": "setPlayerStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_powDiff", - "type": "uint256" - } - ], - "name": "setPowDiff", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "sig", - "type": "bytes" - } - ], - "name": "splitSignature", - "outputs": [ - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "startTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "started", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "submission_success_count", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "volMaxPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "volStart", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] +myABI = [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "challengeID", + "type": "uint256" + } + ], + "name": "ChallengeAddedOrUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "challengeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "ChallengeSolved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "challengeID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "obscuredFlag", + "type": "address" + }, + { + "internalType": "uint256", + "name": "worth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "descriptionFingerprint", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "onlyFirstSolver", + "type": "bool" + }, + { + "internalType": "string", + "name": "skill", + "type": "string" + } + ], + "name": "addOrUpdateChallenge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "contests", + "outputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "string", + "name": "password", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "password", + "type": "string" + } + ], + "name": "createContest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + } + ], + "name": "getContestDeadline", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "player", + "type": "address" + } + ], + "name": "getPlayerScore", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "player", + "type": "address" + } + ], + "name": "getPlayerStatus", + "outputs": [ + { + "internalType": "enum CryptoCTFX.PlayerStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "recoverSigner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "password", + "type": "string" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "setAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "setContestDeadline", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "address", + "name": "player", + "type": "address" + }, + { + "internalType": "enum CryptoCTFX.PlayerStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "setPlayerStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "sig", + "type": "bytes" + } + ], + "name": "splitSignature", + "outputs": [ + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contestID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "challengeID", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "submitFlag", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file