diff --git a/digital-fund b/digital-fund new file mode 160000 index 0000000..f7d60a5 --- /dev/null +++ b/digital-fund @@ -0,0 +1 @@ +Subproject commit f7d60a554e150936f7d5730ddce769fee43fe92a diff --git a/package-lock.json b/package-lock.json index 76332ca..8865735 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,11 +12,13 @@ "@reown/appkit-adapter-wagmi": "^1.8.2", "@vicons/ionicons5": "^0.13.0", "@vueuse/core": "^10.7.2", + "echarts": "^6.0.0", "ethers": "^6.10.0", "naive-ui": "^2.38.1", "pinia": "^2.1.7", "vfonts": "^0.0.3", "vue": "^3.4.0", + "vue-echarts": "^8.0.1", "vue-router": "^4.5.1", "xlsx": "^0.18.5" }, @@ -5008,6 +5010,22 @@ "stream-shift": "^1.0.2" } }, + "node_modules/echarts": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-6.0.0.tgz", + "integrity": "sha512-Tte/grDQRiETQP4xz3iZWSvoHrkCQtwqd6hs+mifXcjrCuo2iKWbajFObuLJVBlDIJlOzgQPd1hsaKt/3+OMkQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "2.3.0", + "zrender": "6.0.0" + } + }, + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "license": "0BSD" + }, "node_modules/eciesjs": { "version": "0.4.15", "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.4.15.tgz", @@ -8335,6 +8353,16 @@ } } }, + "node_modules/vue-echarts": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/vue-echarts/-/vue-echarts-8.0.1.tgz", + "integrity": "sha512-23rJTFLu1OUEGRWjJGmdGt8fP+8+ja1gVgzMYPIPaHWpXegcO1viIAaeu2H4QHESlVeHzUAHIxKXGrwjsyXAaA==", + "license": "MIT", + "peerDependencies": { + "echarts": "^6.0.0", + "vue": "^3.3.0" + } + }, "node_modules/vue-eslint-parser": { "version": "9.4.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz", @@ -8735,6 +8763,21 @@ "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/zrender": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-6.0.0.tgz", + "integrity": "sha512-41dFXEEXuJpNecuUQq6JlbybmnHaqqpGlbH1yxnA5V9MMP4SbohSVZsJIwz+zdjQXSSlR1Vc34EgH1zxyTDvhg==", + "license": "BSD-3-Clause", + "dependencies": { + "tslib": "2.3.0" + } + }, + "node_modules/zrender/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "license": "0BSD" + }, "node_modules/zustand": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.3.tgz", diff --git a/package.json b/package.json index 20b3854..0b1ec2f 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,13 @@ "@reown/appkit-adapter-wagmi": "^1.8.2", "@vicons/ionicons5": "^0.13.0", "@vueuse/core": "^10.7.2", + "echarts": "^6.0.0", "ethers": "^6.10.0", "naive-ui": "^2.38.1", "pinia": "^2.1.7", "vfonts": "^0.0.3", "vue": "^3.4.0", + "vue-echarts": "^8.0.1", "vue-router": "^4.5.1", "xlsx": "^0.18.5" }, diff --git a/src/abis/NavVerifier.json b/src/abis/NavVerifier.json new file mode 100644 index 0000000..dbb29da --- /dev/null +++ b/src/abis/NavVerifier.json @@ -0,0 +1,460 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NavVerifier", + "sourceName": "contracts/NavVerifier.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_staking", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyVoted", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientStake", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCommitment", + "type": "error" + }, + { + "inputs": [], + "name": "NotRevealed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "RoundNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "RoundNotEnded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "teacher", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "NavProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum NavVerifier.RoundStatus", + "name": "status", + "type": "uint8" + } + ], + "name": "RoundFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "VoteCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "support", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + } + ], + "name": "VoteRevealed", + "type": "event" + }, + { + "inputs": [], + "name": "MIN_TEACHER_STAKE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_VERIFIER_STAKE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ROUND_DURATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "voteHash", + "type": "bytes32" + } + ], + "name": "commitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentRoundId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + } + ], + "name": "finalizeRound", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "hasRevealed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "navValue", + "type": "uint256" + } + ], + "name": "proposeNAV", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "roundId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "support", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "name": "revealVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "rounds", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "teacherSubmission", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "address", + "name": "teacher", + "type": "address" + }, + { + "internalType": "enum NavVerifier.RoundStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "totalYesStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalNoStake", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "contract Staking", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "voteCommits", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60a060405234801561001057600080fd5b50604051611c35380380611c3583398181016040528101906100329190610216565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100a55760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161009c9190610252565b60405180910390fd5b6100b4816100ef60201b60201c565b508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250505061026d565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101e3826101b8565b9050919050565b6101f3816101d8565b81146101fe57600080fd5b50565b600081519050610210816101ea565b92915050565b60006020828403121561022c5761022b6101b3565b5b600061023a84828501610201565b91505092915050565b61024c816101d8565b82525050565b60006020820190506102676000830184610243565b92915050565b6080516119916102a4600039600081816104d10152818161061c015281816107f901528181610b7b0152610cb201526119916000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80638da5cb5b11610097578063ad4eb45c11610066578063ad4eb45c14610257578063d159a8da14610273578063f280b5e51461028f578063f2fde38b146102bf576100f5565b80638da5cb5b146101e15780638e301186146101ff5780639cbe5efd1461021d5780639da691801461023b576100f5565b80636641ea08116100d35780636641ea0814610164578063715018a6146101825780638123628a1461018c5780638c65c81f146101aa576100f5565b806316b5551d146100fa5780633469f6e21461012a5780634cf088d914610146575b600080fd5b610114600480360381019061010f91906111e6565b6102db565b6040516101219190611241565b60405180910390f35b610144600480360381019061013f919061125c565b61030a565b005b61014e61061a565b60405161015b91906112e8565b60405180910390f35b61016c61063e565b6040516101799190611312565b60405180910390f35b61018a610644565b005b610194610658565b6040516101a19190611312565b60405180910390f35b6101c460048036038101906101bf919061125c565b610665565b6040516101d89897969594939291906113b3565b60405180910390f35b6101e96106da565b6040516101f69190611431565b60405180910390f35b610207610703565b6040516102149190611312565b60405180910390f35b610225610710565b6040516102329190611312565b60405180910390f35b61025560048036038101906102509190611482565b610716565b005b610271600480360381019061026c91906114ee565b61096f565b005b61028d6004803603810190610288919061125c565b610cb0565b005b6102a960048036038101906102a491906111e6565b610f4f565b6040516102b69190611550565b60405180910390f35b6102d960048036038101906102d4919061156b565b610f74565b005b60046020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006001600083815260200190815260200160002090508060030154421161035e576040517fc43172d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060038111156103725761037161133c565b5b8160040160149054906101000a900460ff1660038111156103965761039561133c565b5b146103d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cd906115f5565b60405180910390fd5b6000816006015482600501546103ec9190611644565b9050600081036104285760028260040160146101000a81548160ff0219169083600381111561041e5761041d61133c565b5b02179055506105cc565b60036002826104379190611678565b61044191906116e9565b8260050154111561047e5760018260040160146101000a81548160ff021916908360038111156104745761047361133c565b5b02179055506105cb565b600360028261048d9190611678565b61049791906116e9565b8260060154111561059c5760028260040160146101000a81548160ff021916908360038111156104ca576104c961133c565b5b02179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bfac59908360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002683635c9adc5dea0000061054691906116e9565b306040518463ffffffff1660e01b81526004016105659392919061171a565b600060405180830381600087803b15801561057f57600080fd5b505af1158015610593573d6000803e3d6000fd5b505050506105ca565b60038260040160146101000a81548160ff021916908360038111156105c4576105c361133c565b5b02179055505b5b5b827f8b34f065da3d2a9e045f7225390c844ae50e905cafa35bbb98e132de1d39195c8360040160149054906101000a900460ff1660405161060d9190611751565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610e1081565b61064c610ffa565b6106566000611081565b565b683635c9adc5dea0000081565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16908060050154908060060154905088565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b68056bc75e2d6310000081565b60025481565b6000600160008481526020019081526020016000209050806003015442111561076b576040517f3df07da500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000801b6003600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146107f7576040517f7c9a1cf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662b189643368056bc75e2d631000006040518363ffffffff1660e01b815260040161085a92919061176c565b602060405180830381865afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b91906117aa565b6108d1576040517ff1bc94d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816003600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16837f3834a2c8ea101e1468b529270d35fbff0a12de32a5a7e5729b8b4dad6fb32c0160405160405180910390a3505050565b6000600160008581526020019081526020016000209050806003015442116109c3576040517f3df07da500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a58576040517f7c9a1cf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383604051602001610a6d929190611840565b604051602081830303815290604052805190602001209050806003600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610b0e576040517fc06789fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016004600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166316934fc4336040518263ffffffff1660e01b8152600401610bd29190611431565b6040805180830381865afa158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c129190611881565b5090508415610c3b5780836005016000828254610c2f9190611644565b92505081905550610c57565b80836006016000828254610c4f9190611644565b925050819055505b3373ffffffffffffffffffffffffffffffffffffffff16867f96b7e5dbd1a0bb4b34731d1dfce6ea83eab3fadbf4710c77ad43106f771f90fb8784604051610ca09291906118c1565b60405180910390a3505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662b1896433683635c9adc5dea000006040518363ffffffff1660e01b8152600401610d1392919061176c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5491906117aa565b610d8a576040517ff1bc94d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026000815480929190610d9d906118ea565b919050555060006002549050604051806101000160405280828152602001838152602001428152602001610e1042610dd59190611644565b81526020013373ffffffffffffffffffffffffffffffffffffffff16815260200160006003811115610e0a57610e0961133c565b5b8152602001600081526020016000815250600160008381526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160040160146101000a81548160ff02191690836003811115610ec857610ec761133c565b5b021790555060c0820151816005015560e082015181600601559050503373ffffffffffffffffffffffffffffffffffffffff16817fbba10851bc465b085dfe0b7a271da4ce709a072ce454b792d133bafcd74e61cb846001600086815260200190815260200160002060030154604051610f43929190611932565b60405180910390a35050565b6003602052816000526040600020602052806000526040600020600091509150505481565b610f7c610ffa565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fee5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610fe59190611431565b60405180910390fd5b610ff781611081565b50565b611002611145565b73ffffffffffffffffffffffffffffffffffffffff166110206106da565b73ffffffffffffffffffffffffffffffffffffffff161461107f57611043611145565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016110769190611431565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b6000819050919050565b61116581611152565b811461117057600080fd5b50565b6000813590506111828161115c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006111b382611188565b9050919050565b6111c3816111a8565b81146111ce57600080fd5b50565b6000813590506111e0816111ba565b92915050565b600080604083850312156111fd576111fc61114d565b5b600061120b85828601611173565b925050602061121c858286016111d1565b9150509250929050565b60008115159050919050565b61123b81611226565b82525050565b60006020820190506112566000830184611232565b92915050565b6000602082840312156112725761127161114d565b5b600061128084828501611173565b91505092915050565b6000819050919050565b60006112ae6112a96112a484611188565b611289565b611188565b9050919050565b60006112c082611293565b9050919050565b60006112d2826112b5565b9050919050565b6112e2816112c7565b82525050565b60006020820190506112fd60008301846112d9565b92915050565b61130c81611152565b82525050565b60006020820190506113276000830184611303565b92915050565b611336816111a8565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061137c5761137b61133c565b5b50565b600081905061138d8261136b565b919050565b600061139d8261137f565b9050919050565b6113ad81611392565b82525050565b6000610100820190506113c9600083018b611303565b6113d6602083018a611303565b6113e36040830189611303565b6113f06060830188611303565b6113fd608083018761132d565b61140a60a08301866113a4565b61141760c0830185611303565b61142460e0830184611303565b9998505050505050505050565b6000602082019050611446600083018461132d565b92915050565b6000819050919050565b61145f8161144c565b811461146a57600080fd5b50565b60008135905061147c81611456565b92915050565b600080604083850312156114995761149861114d565b5b60006114a785828601611173565b92505060206114b88582860161146d565b9150509250929050565b6114cb81611226565b81146114d657600080fd5b50565b6000813590506114e8816114c2565b92915050565b6000806000606084860312156115075761150661114d565b5b600061151586828701611173565b9350506020611526868287016114d9565b925050604061153786828701611173565b9150509250925092565b61154a8161144c565b82525050565b60006020820190506115656000830184611541565b92915050565b6000602082840312156115815761158061114d565b5b600061158f848285016111d1565b91505092915050565b600082825260208201905092915050565b7f416c72656164792066696e616c697a6564000000000000000000000000000000600082015250565b60006115df601183611598565b91506115ea826115a9565b602082019050919050565b6000602082019050818103600083015261160e816115d2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061164f82611152565b915061165a83611152565b925082820190508082111561167257611671611615565b5b92915050565b600061168382611152565b915061168e83611152565b925082820261169c81611152565b915082820484148315176116b3576116b2611615565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116f482611152565b91506116ff83611152565b92508261170f5761170e6116ba565b5b828204905092915050565b600060608201905061172f600083018661132d565b61173c6020830185611303565b611749604083018461132d565b949350505050565b600060208201905061176660008301846113a4565b92915050565b6000604082019050611781600083018561132d565b61178e6020830184611303565b9392505050565b6000815190506117a4816114c2565b92915050565b6000602082840312156117c0576117bf61114d565b5b60006117ce84828501611795565b91505092915050565b60008160f81b9050919050565b60006117ef826117d7565b9050919050565b6000611801826117e4565b9050919050565b61181961181482611226565b6117f6565b82525050565b6000819050919050565b61183a61183582611152565b61181f565b82525050565b600061184c8285611808565b60018201915061185c8284611829565b6020820191508190509392505050565b60008151905061187b8161115c565b92915050565b600080604083850312156118985761189761114d565b5b60006118a68582860161186c565b92505060206118b78582860161186c565b9150509250929050565b60006040820190506118d66000830185611232565b6118e36020830184611303565b9392505050565b60006118f582611152565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361192757611926611615565b5b600182019050919050565b60006040820190506119476000830185611303565b6119546020830184611303565b939250505056fea2646970667358221220e5aa2f516b39c5cbd729e2d64de89ccb26585f341fcc60d5ba4bf27a15a2546164736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80638da5cb5b11610097578063ad4eb45c11610066578063ad4eb45c14610257578063d159a8da14610273578063f280b5e51461028f578063f2fde38b146102bf576100f5565b80638da5cb5b146101e15780638e301186146101ff5780639cbe5efd1461021d5780639da691801461023b576100f5565b80636641ea08116100d35780636641ea0814610164578063715018a6146101825780638123628a1461018c5780638c65c81f146101aa576100f5565b806316b5551d146100fa5780633469f6e21461012a5780634cf088d914610146575b600080fd5b610114600480360381019061010f91906111e6565b6102db565b6040516101219190611241565b60405180910390f35b610144600480360381019061013f919061125c565b61030a565b005b61014e61061a565b60405161015b91906112e8565b60405180910390f35b61016c61063e565b6040516101799190611312565b60405180910390f35b61018a610644565b005b610194610658565b6040516101a19190611312565b60405180910390f35b6101c460048036038101906101bf919061125c565b610665565b6040516101d89897969594939291906113b3565b60405180910390f35b6101e96106da565b6040516101f69190611431565b60405180910390f35b610207610703565b6040516102149190611312565b60405180910390f35b610225610710565b6040516102329190611312565b60405180910390f35b61025560048036038101906102509190611482565b610716565b005b610271600480360381019061026c91906114ee565b61096f565b005b61028d6004803603810190610288919061125c565b610cb0565b005b6102a960048036038101906102a491906111e6565b610f4f565b6040516102b69190611550565b60405180910390f35b6102d960048036038101906102d4919061156b565b610f74565b005b60046020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006001600083815260200190815260200160002090508060030154421161035e576040517fc43172d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060038111156103725761037161133c565b5b8160040160149054906101000a900460ff1660038111156103965761039561133c565b5b146103d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cd906115f5565b60405180910390fd5b6000816006015482600501546103ec9190611644565b9050600081036104285760028260040160146101000a81548160ff0219169083600381111561041e5761041d61133c565b5b02179055506105cc565b60036002826104379190611678565b61044191906116e9565b8260050154111561047e5760018260040160146101000a81548160ff021916908360038111156104745761047361133c565b5b02179055506105cb565b600360028261048d9190611678565b61049791906116e9565b8260060154111561059c5760028260040160146101000a81548160ff021916908360038111156104ca576104c961133c565b5b02179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bfac59908360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002683635c9adc5dea0000061054691906116e9565b306040518463ffffffff1660e01b81526004016105659392919061171a565b600060405180830381600087803b15801561057f57600080fd5b505af1158015610593573d6000803e3d6000fd5b505050506105ca565b60038260040160146101000a81548160ff021916908360038111156105c4576105c361133c565b5b02179055505b5b5b827f8b34f065da3d2a9e045f7225390c844ae50e905cafa35bbb98e132de1d39195c8360040160149054906101000a900460ff1660405161060d9190611751565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610e1081565b61064c610ffa565b6106566000611081565b565b683635c9adc5dea0000081565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16908060050154908060060154905088565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b68056bc75e2d6310000081565b60025481565b6000600160008481526020019081526020016000209050806003015442111561076b576040517f3df07da500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000801b6003600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146107f7576040517f7c9a1cf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662b189643368056bc75e2d631000006040518363ffffffff1660e01b815260040161085a92919061176c565b602060405180830381865afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b91906117aa565b6108d1576040517ff1bc94d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816003600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16837f3834a2c8ea101e1468b529270d35fbff0a12de32a5a7e5729b8b4dad6fb32c0160405160405180910390a3505050565b6000600160008581526020019081526020016000209050806003015442116109c3576040517f3df07da500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a58576040517f7c9a1cf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383604051602001610a6d929190611840565b604051602081830303815290604052805190602001209050806003600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610b0e576040517fc06789fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016004600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166316934fc4336040518263ffffffff1660e01b8152600401610bd29190611431565b6040805180830381865afa158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c129190611881565b5090508415610c3b5780836005016000828254610c2f9190611644565b92505081905550610c57565b80836006016000828254610c4f9190611644565b925050819055505b3373ffffffffffffffffffffffffffffffffffffffff16867f96b7e5dbd1a0bb4b34731d1dfce6ea83eab3fadbf4710c77ad43106f771f90fb8784604051610ca09291906118c1565b60405180910390a3505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1662b1896433683635c9adc5dea000006040518363ffffffff1660e01b8152600401610d1392919061176c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5491906117aa565b610d8a576040517ff1bc94d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026000815480929190610d9d906118ea565b919050555060006002549050604051806101000160405280828152602001838152602001428152602001610e1042610dd59190611644565b81526020013373ffffffffffffffffffffffffffffffffffffffff16815260200160006003811115610e0a57610e0961133c565b5b8152602001600081526020016000815250600160008381526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a08201518160040160146101000a81548160ff02191690836003811115610ec857610ec761133c565b5b021790555060c0820151816005015560e082015181600601559050503373ffffffffffffffffffffffffffffffffffffffff16817fbba10851bc465b085dfe0b7a271da4ce709a072ce454b792d133bafcd74e61cb846001600086815260200190815260200160002060030154604051610f43929190611932565b60405180910390a35050565b6003602052816000526040600020602052806000526040600020600091509150505481565b610f7c610ffa565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610fee5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610fe59190611431565b60405180910390fd5b610ff781611081565b50565b611002611145565b73ffffffffffffffffffffffffffffffffffffffff166110206106da565b73ffffffffffffffffffffffffffffffffffffffff161461107f57611043611145565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016110769190611431565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b6000819050919050565b61116581611152565b811461117057600080fd5b50565b6000813590506111828161115c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006111b382611188565b9050919050565b6111c3816111a8565b81146111ce57600080fd5b50565b6000813590506111e0816111ba565b92915050565b600080604083850312156111fd576111fc61114d565b5b600061120b85828601611173565b925050602061121c858286016111d1565b9150509250929050565b60008115159050919050565b61123b81611226565b82525050565b60006020820190506112566000830184611232565b92915050565b6000602082840312156112725761127161114d565b5b600061128084828501611173565b91505092915050565b6000819050919050565b60006112ae6112a96112a484611188565b611289565b611188565b9050919050565b60006112c082611293565b9050919050565b60006112d2826112b5565b9050919050565b6112e2816112c7565b82525050565b60006020820190506112fd60008301846112d9565b92915050565b61130c81611152565b82525050565b60006020820190506113276000830184611303565b92915050565b611336816111a8565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6004811061137c5761137b61133c565b5b50565b600081905061138d8261136b565b919050565b600061139d8261137f565b9050919050565b6113ad81611392565b82525050565b6000610100820190506113c9600083018b611303565b6113d6602083018a611303565b6113e36040830189611303565b6113f06060830188611303565b6113fd608083018761132d565b61140a60a08301866113a4565b61141760c0830185611303565b61142460e0830184611303565b9998505050505050505050565b6000602082019050611446600083018461132d565b92915050565b6000819050919050565b61145f8161144c565b811461146a57600080fd5b50565b60008135905061147c81611456565b92915050565b600080604083850312156114995761149861114d565b5b60006114a785828601611173565b92505060206114b88582860161146d565b9150509250929050565b6114cb81611226565b81146114d657600080fd5b50565b6000813590506114e8816114c2565b92915050565b6000806000606084860312156115075761150661114d565b5b600061151586828701611173565b9350506020611526868287016114d9565b925050604061153786828701611173565b9150509250925092565b61154a8161144c565b82525050565b60006020820190506115656000830184611541565b92915050565b6000602082840312156115815761158061114d565b5b600061158f848285016111d1565b91505092915050565b600082825260208201905092915050565b7f416c72656164792066696e616c697a6564000000000000000000000000000000600082015250565b60006115df601183611598565b91506115ea826115a9565b602082019050919050565b6000602082019050818103600083015261160e816115d2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061164f82611152565b915061165a83611152565b925082820190508082111561167257611671611615565b5b92915050565b600061168382611152565b915061168e83611152565b925082820261169c81611152565b915082820484148315176116b3576116b2611615565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116f482611152565b91506116ff83611152565b92508261170f5761170e6116ba565b5b828204905092915050565b600060608201905061172f600083018661132d565b61173c6020830185611303565b611749604083018461132d565b949350505050565b600060208201905061176660008301846113a4565b92915050565b6000604082019050611781600083018561132d565b61178e6020830184611303565b9392505050565b6000815190506117a4816114c2565b92915050565b6000602082840312156117c0576117bf61114d565b5b60006117ce84828501611795565b91505092915050565b60008160f81b9050919050565b60006117ef826117d7565b9050919050565b6000611801826117e4565b9050919050565b61181961181482611226565b6117f6565b82525050565b6000819050919050565b61183a61183582611152565b61181f565b82525050565b600061184c8285611808565b60018201915061185c8284611829565b6020820191508190509392505050565b60008151905061187b8161115c565b92915050565b600080604083850312156118985761189761114d565b5b60006118a68582860161186c565b92505060206118b78582860161186c565b9150509250929050565b60006040820190506118d66000830185611232565b6118e36020830184611303565b9392505050565b60006118f582611152565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361192757611926611615565b5b600182019050919050565b60006040820190506119476000830185611303565b6119546020830184611303565b939250505056fea2646970667358221220e5aa2f516b39c5cbd729e2d64de89ccb26585f341fcc60d5ba4bf27a15a2546164736f6c634300081b0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/components/NavHistoryChart.vue b/src/components/NavHistoryChart.vue new file mode 100644 index 0000000..fa6a779 --- /dev/null +++ b/src/components/NavHistoryChart.vue @@ -0,0 +1,103 @@ + + + + + + + diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index eaca9f1..6c0b790 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -216,6 +216,7 @@ const menuOptions: MenuOption[] = [ key: '/event-history', icon: renderIcon(ListOutline) }, + { label: '合约管理', key: '/contract-management', diff --git a/src/router/index.ts b/src/router/index.ts index 857b2ff..5cc7399 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -51,23 +51,24 @@ const routes = [ meta: { requiresAuth: true, title: '事件历史' } }, { - path: '/nav-validation', - name: 'NAVValidation', - component: () => import('../views/NAVValidation.vue'), - meta: { - requiresAuth: true, - title: 'NAV 验证' - } - }, - { - path: '/nav-validator-management', - name: 'NAVValidatorManagement', - component: () => import('../views/NAVValidatorManagement.vue'), - meta: { - requiresAuth: true, - title: 'NAV 验证者管理' - } + path: '/nav-validation', + name: 'NAVValidation', + component: () => import('../views/NAVValidation.vue'), + meta: { + requiresAuth: true, + title: 'NAV 验证' } + }, + { + path: '/nav-validator-management', + name: 'NAVValidatorManagement', + component: () => import('../views/NAVValidatorManagement.vue'), + meta: { + requiresAuth: true, + title: 'NAV 验证者管理' + } + }, + ] }, { diff --git a/src/views/NAVValidation.vue b/src/views/NAVValidation.vue index 016cd40..643585d 100644 --- a/src/views/NAVValidation.vue +++ b/src/views/NAVValidation.vue @@ -1,381 +1,325 @@ - + - NAV 验证提交 - 提交NAV验证和查看验证历史 + NAV PoS Dashboard + 监控去中心化 NAV 共识状态,或进行紧急手动干预。 - - - - - - - 验证说明 - • NAV 变更验证:需要提供旧 NAV 值和新 NAV 值 - - - - - - $ - - - - - - $ - - - - - - + + + + + + + + {{ currentRound.statusText }} + + + + + 合约: {{ contractAddress.slice(0, 6) }}...{{ contractAddress.slice(-4) }} + + + + + + + + + 提议者: + {{ formatAddr(currentRound.teacher) }} + + + NAV: + {{ currentRound.nav }} + + + 结束时间: + {{ formatTime(currentRound.endTime) }} + + + + + + + + + + + + {{ isValidator ? '我是验证者' : '观察者模式' }} + + + + + + + + + + - - - - - - - - 提交变更验证 - - 重置 - - + + + - - - - - - - - - - 刷新记录 - - + + + + {{ showLegacy ? '收起提案表格' : '手动发起提案 (Teacher Mode)' }} + + + + + + + 提示:作为 Teacher,您可以手动提交 NAV 提案。需确保您的钱包已完成质押 (1000 CINA)。 + + + + + + + + $ + + + + + + + 提交上链提案 (Propose) + + + + + - - \ No newline at end of file
提交NAV验证和查看验证历史
监控去中心化 NAV 共识状态,或进行紧急手动干预。
• NAV 变更验证:需要提供旧 NAV 值和新 NAV 值