From 70fab7fc60ac26d1fd26b3ba3caaf91c4b0f0554 Mon Sep 17 00:00:00 2001 From: Ayush Acharjya Date: Sat, 26 Oct 2024 13:32:39 +0100 Subject: [PATCH] update .gitignore to remove cache --- .gitignore | 3 +- cache/solidity-files-cache.json | 2044 ------------------------------- contracts/EventManager.sol | 396 +++--- 3 files changed, 236 insertions(+), 2207 deletions(-) delete mode 100644 cache/solidity-files-cache.json diff --git a/.gitignore b/.gitignore index b605942..09c9c8f 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts artifacts -typechain-types \ No newline at end of file +typechain-types +cache \ No newline at end of file diff --git a/cache/solidity-files-cache.json b/cache/solidity-files-cache.json deleted file mode 100644 index 12a5c04..0000000 --- a/cache/solidity-files-cache.json +++ /dev/null @@ -1,2044 +0,0 @@ -{ - "_format": "hh-sol-cache-2", - "files": { - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\ISortition.sol": { - "lastModificationDate": 1729942398074, - "contentHash": "81fe09c0ff335e32e8f95dc1764c72fc", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/ISortition.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./IBn256.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": [] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IBn256.sol": { - "lastModificationDate": 1729942383904, - "contentHash": "f3307d9c5538a6de467dbf367a46e3b1", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IBn256.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": [] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFixedPointArithmetic.sol": { - "lastModificationDate": 1729942391936, - "contentHash": "bf49ebebf5d9e9bc486b5555c482bbe7", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFixedPointArithmetic.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": [] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\contracts\\Escrow.sol": { - "lastModificationDate": 1729942337270, - "contentHash": "8017bf5de650f4131e761b0ee65e80a5", - "sourceName": "contracts/Escrow.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.8.2 <0.9.0"], - "artifacts": ["Escrow"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\contracts\\EventManager.sol": { - "lastModificationDate": 1729942674734, - "contentHash": "f211c6305272f752701edbc44ac26721", - "sourceName": "contracts/EventManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.8.2 <0.9.0"], - "artifacts": ["EventManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\contracts\\FlareOracle.sol": { - "lastModificationDate": 1729942337272, - "contentHash": "2526038a459bb55e7396817deb473f64", - "sourceName": "contracts/FlareOracle.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol", - "@flarenetwork/flare-periphery-contracts/coston2/TestFtsoV2Interface.sol" - ], - "versionPragmas": [">=0.8.0 <0.9.0"], - "artifacts": ["FtsoV2FeedConsumer"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\ContractRegistry.sol": { - "lastModificationDate": 1729942377684, - "contentHash": "6786a5d4608433fbb81492dbdc4814df", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IFlareContractRegistry.sol", - "./IPriceSubmitter.sol", - "./IGovernanceSettings.sol", - "./IFtsoRewardManager.sol", - "./IFtsoRegistry.sol", - "./IVoterWhitelister.sol", - "./IDistributionToDelegators.sol", - "./IFtsoManager.sol", - "./IWNat.sol", - "./IGovernanceVotePower.sol", - "./IClaimSetupManager.sol", - "./IGenericRewardManager.sol", - "./IFlareAssetRegistry.sol", - "./IValidatorRegistry.sol", - "./IFlareContractRegistry.sol", - "./IPollingFtso.sol", - "./IAddressBinder.sol", - "./IPChainStakeMirror.sol", - "./IPChainStakeMirrorVerifier.sol", - "./IPChainStakeMirrorMultiSigVoting.sol", - "./ISubmission.sol", - "./IEntityManager.sol", - "./IVoterRegistry.sol", - "./IFlareSystemsCalculator.sol", - "./IFlareSystemsManager.sol", - "./IRewardManager.sol", - "./IRelay.sol", - "./IWNatDelegationFee.sol", - "./IFtsoInflationConfigurations.sol", - "./IFtsoRewardOffersManager.sol", - "./IFtsoFeedDecimals.sol", - "./IFtsoFeedPublisher.sol", - "./IFtsoFeedIdConverter.sol", - "./IFastUpdateIncentiveManager.sol", - "./IFastUpdater.sol", - "./IFastUpdatesConfiguration.sol", - "./IRNat.sol", - "./IFeeCalculator.sol", - "./FtsoV2Interface.sol", - "./TestFtsoV2Interface.sol", - "./ProtocolsV2Interface.sol", - "./RandomNumberV2Interface.sol", - "./RewardsV2Interface.sol" - ], - "versionPragmas": ["^0.8.0"], - "artifacts": ["ContractRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\TestFtsoV2Interface.sol": { - "lastModificationDate": 1729942399328, - "contentHash": "e37208d8b92a76ab014c03df2ab34dca", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/TestFtsoV2Interface.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["TestFtsoV2Interface"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPriceSubmitter.sol": { - "lastModificationDate": 1729942397697, - "contentHash": "d333aeddfe65d8c22265935d873d6f3b", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPriceSubmitter.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./genesis/interface/IFtsoGenesis.sol", - "./genesis/interface/IFtsoRegistryGenesis.sol", - "./genesis/interface/IFtsoManagerGenesis.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPriceSubmitter"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFlareContractRegistry.sol": { - "lastModificationDate": 1729942392604, - "contentHash": "66432d995c94bdef8a57349adab18a69", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFlareContractRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFlareContractRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoRegistry.sol": { - "lastModificationDate": 1729942395219, - "contentHash": "1f025414a37439832a1cc1cedaef1883", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./ftso/interface/IIFtso.sol", - "./genesis/interface/IFtsoRegistryGenesis.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IWNat.sol": { - "lastModificationDate": 1729942398630, - "contentHash": "86c55906a9470e83551c7ab7af1b9858", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IWNat.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./IVPToken.sol", "./token/interface/IICleanable.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IWNat"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoRewardManager.sol": { - "lastModificationDate": 1729942395444, - "contentHash": "9ad327d33e6a9cfe08bd1d8b7563bf3e", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoRewardManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoRewardManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IGovernanceVotePower.sol": { - "lastModificationDate": 1729942395811, - "contentHash": "908cbc6470c161e05605ad556bb7144d", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IGovernanceVotePower.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IGovernanceVotePower"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IGovernanceSettings.sol": { - "lastModificationDate": 1729942395728, - "contentHash": "3d6422a752bb9b572fc5f6b129523d77", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IGovernanceSettings.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IGovernanceSettings"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IDistributionToDelegators.sol": { - "lastModificationDate": 1729942388110, - "contentHash": "824c7bc04dbd13517d09e1a481906c83", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IDistributionToDelegators.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IDistributionToDelegators"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFlareAssetRegistry.sol": { - "lastModificationDate": 1729942392260, - "contentHash": "9c158fd42b512d4ecfb4fbfb1ca06139", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFlareAssetRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFlareAssetRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoManager.sol": { - "lastModificationDate": 1729942395035, - "contentHash": "b54321d7fc578d90929c89e937932dd9", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./ftso/interface/IIFtso.sol", - "./genesis/interface/IFtsoManagerGenesis.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IClaimSetupManager.sol": { - "lastModificationDate": 1729942386830, - "contentHash": "8f99f83895a9da4a2d401f6b41e0d972", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IClaimSetupManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IDelegationAccount.sol", - "@openzeppelin/contracts/token/ERC20/IERC20.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IClaimSetupManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IGenericRewardManager.sol": { - "lastModificationDate": 1729942395642, - "contentHash": "0a90708b5aa1514571d14baf66095e1a", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IGenericRewardManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IGenericRewardManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IValidatorRegistry.sol": { - "lastModificationDate": 1729942398150, - "contentHash": "481536991812748c9995b34e25d87108", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IValidatorRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IValidatorRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IAddressBinder.sol": { - "lastModificationDate": 1729942382502, - "contentHash": "14ea3812e349acc9629446bb1e1864c9", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IAddressBinder.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IAddressBinder"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPollingFtso.sol": { - "lastModificationDate": 1729942397653, - "contentHash": "f304295d2213a79de1f43a2e205ae877", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPollingFtso.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPollingFtso"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPChainStakeMirrorMultiSigVoting.sol": { - "lastModificationDate": 1729942397578, - "contentHash": "5f0d56228ade72cddb2ca3dd6ad28da0", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPChainStakeMirrorMultiSigVoting.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPChainStakeMirrorMultiSigVoting"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPChainStakeMirrorVerifier.sol": { - "lastModificationDate": 1729942397597, - "contentHash": "aeafcd3d0b8d62fda77e619b56d0fbc6", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPChainStakeMirrorVerifier.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPChainStakeMirrorVerifier"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPChainStakeMirror.sol": { - "lastModificationDate": 1729942397561, - "contentHash": "86af52806017fbf2efda037720260911", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPChainStakeMirror.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./IPChainVotePower.sol", "./IPChainStakeMirrorVerifier.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPChainStakeMirror"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\ISubmission.sol": { - "lastModificationDate": 1729942398110, - "contentHash": "df8351f9e3232e8df6f6e80cc1b1e2c9", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/ISubmission.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./IRandomProvider.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["ISubmission"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFlareSystemsCalculator.sol": { - "lastModificationDate": 1729942393306, - "contentHash": "368352479e77210f7040c7b0b528aaf6", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFlareSystemsCalculator.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFlareSystemsCalculator"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IEntityManager.sol": { - "lastModificationDate": 1729942388667, - "contentHash": "6a4668e991c53b185442f136cb5ba14f", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IEntityManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IEntityManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IVoterRegistry.sol": { - "lastModificationDate": 1729942398294, - "contentHash": "a393fd22c141b5b314c844e2830d92fe", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IVoterRegistry.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IVoterRegistry"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IWNatDelegationFee.sol": { - "lastModificationDate": 1729942398682, - "contentHash": "d485dbec165b37f45c70a550df3d3d2f", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IWNatDelegationFee.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IWNatDelegationFee"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IRelay.sol": { - "lastModificationDate": 1729942397820, - "contentHash": "991b86ed9f48fa9b234539a2e253ae50", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IRelay.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./RandomNumberV2Interface.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IRelay"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IRewardManager.sol": { - "lastModificationDate": 1729942397864, - "contentHash": "be6dd50a8e4830bb5eac08653c396bcf", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IRewardManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./RewardsV2Interface.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IRewardManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFlareSystemsManager.sol": { - "lastModificationDate": 1729942393500, - "contentHash": "ba1a4f3491d2a58b798740b58f8769fe", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFlareSystemsManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./ProtocolsV2Interface.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFlareSystemsManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoFeedDecimals.sol": { - "lastModificationDate": 1729942393911, - "contentHash": "83c66613e0cb473d3a7f99ddc2ab6860", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoFeedDecimals.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoFeedDecimals"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoRewardOffersManager.sol": { - "lastModificationDate": 1729942395556, - "contentHash": "530127323c60b18028a3c21a0fcabf0e", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoRewardOffersManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoRewardOffersManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoFeedPublisher.sol": { - "lastModificationDate": 1729942394437, - "contentHash": "954e2dc14cba44616f7573956355829e", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoFeedPublisher.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoFeedPublisher"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoInflationConfigurations.sol": { - "lastModificationDate": 1729942394901, - "contentHash": "3a193e07233cf50b6daadf75a54764ec", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoInflationConfigurations.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoInflationConfigurations"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFastUpdateIncentiveManager.sol": { - "lastModificationDate": 1729942389419, - "contentHash": "34eb7a4a41076dfb068ede3adcac6178", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFastUpdateIncentiveManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IFixedPointArithmetic.sol", - "./IFastUpdatesConfiguration.sol", - "./IIncreaseManager.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFastUpdateIncentiveManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFastUpdater.sol": { - "lastModificationDate": 1729942389861, - "contentHash": "be1143be7ec4b588283baa5f745f1d0a", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFastUpdater.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./ISortition.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFastUpdater"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFeeCalculator.sol": { - "lastModificationDate": 1729942391564, - "contentHash": "5cbc28938421fe04f818796746c34267", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFeeCalculator.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFeeCalculator"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtsoFeedIdConverter.sol": { - "lastModificationDate": 1729942394076, - "contentHash": "a848e72b6b0013ee3ac79f0d7ce5129c", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtsoFeedIdConverter.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoFeedIdConverter"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFastUpdatesConfiguration.sol": { - "lastModificationDate": 1729942390778, - "contentHash": "317bcbe67b102043af13be5b722dec20", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFastUpdatesConfiguration.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFastUpdatesConfiguration"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IRNat.sol": { - "lastModificationDate": 1729942397975, - "contentHash": "a8643b068ed0a7610011cd856cd6397b", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IRNat.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IRNatAccount.sol", - "./IWNat.sol", - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IRNat"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\ProtocolsV2Interface.sol": { - "lastModificationDate": 1729942398919, - "contentHash": "e69a09fd86c1f0026b081be7d0ed92d8", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/ProtocolsV2Interface.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["ProtocolsV2Interface"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IVoterWhitelister.sol": { - "lastModificationDate": 1729942398345, - "contentHash": "666aa099ca75ac30e0d4b4246a0e9b1c", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IVoterWhitelister.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IVoterWhitelister"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\FtsoV2Interface.sol": { - "lastModificationDate": 1729942380849, - "contentHash": "200d81a8bcff0c592fdcc261dbf4c43c", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/FtsoV2Interface.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["FtsoV2Interface"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\RandomNumberV2Interface.sol": { - "lastModificationDate": 1729942399004, - "contentHash": "7a59e6d96dfb250e513dd3bed5d26225", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/RandomNumberV2Interface.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["RandomNumberV2Interface"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\RewardsV2Interface.sol": { - "lastModificationDate": 1729942399114, - "contentHash": "e437ec05d4f23ceb1b72454d4d87356a", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/RewardsV2Interface.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["RewardsV2Interface"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\genesis\\interface\\IFtsoRegistryGenesis.sol": { - "lastModificationDate": 1729942395306, - "contentHash": "daf0fdff2cd698a1e95f75d8202626c0", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/genesis/interface/IFtsoRegistryGenesis.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["./IFtsoGenesis.sol"], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoRegistryGenesis"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\genesis\\interface\\IFtsoGenesis.sol": { - "lastModificationDate": 1729942394598, - "contentHash": "1281e01bbe1cdfb4970a20deceeadba7", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/genesis/interface/IFtsoGenesis.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoGenesis"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\genesis\\interface\\IFtsoManagerGenesis.sol": { - "lastModificationDate": 1729942395138, - "contentHash": "01516c640f70ae764a5a53db33f17257", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/genesis/interface/IFtsoManagerGenesis.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtsoManagerGenesis"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\ftso\\interface\\IIFtso.sol": { - "lastModificationDate": 1729942396450, - "contentHash": "b015284e21fdc943e6e98969d6f1921f", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/ftso/interface/IIFtso.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "../../genesis/interface/IFtsoGenesis.sol", - "../../IFtso.sol", - "../../token/interface/IIVPToken.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IIFtso"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IFtso.sol": { - "lastModificationDate": 1729942393742, - "contentHash": "4c2c2cad5921e38ccbd787547ac02e19", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IFtso.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IFtso"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\token\\interface\\IIVPToken.sol": { - "lastModificationDate": 1729942397526, - "contentHash": "1312f76c993e6368044c2e8129c1f9eb", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/token/interface/IIVPToken.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "../../IVPToken.sol", - "../../IGovernanceVotePower.sol", - "./IIVPContract.sol", - "./IIGovernanceVotePower.sol", - "./IICleanable.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IIVPToken"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IVPToken.sol": { - "lastModificationDate": 1729942398558, - "contentHash": "bc9bcb45c382244b3f286d3150f7b14d", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IVPToken.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "@openzeppelin/contracts/token/ERC20/IERC20.sol", - "./IGovernanceVotePower.sol", - "./IVPContractEvents.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IVPToken"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\token\\interface\\IICleanable.sol": { - "lastModificationDate": 1729942396093, - "contentHash": "cb560dd0b1683c03c1e2abddf166dfed", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/token/interface/IICleanable.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IICleanable"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\token\\interface\\IIVPContract.sol": { - "lastModificationDate": 1729942397483, - "contentHash": "baf077d9ad6a34c0ad6f3ed167cafcb2", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/token/interface/IIVPContract.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "../../IVPToken.sol", - "../../IVPContractEvents.sol", - "./IICleanable.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IIVPContract"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\token\\interface\\IIGovernanceVotePower.sol": { - "lastModificationDate": 1729942396520, - "contentHash": "9821f6ced2f0e4e185f9702fda50a736", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/token/interface/IIGovernanceVotePower.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "../../IVPToken.sol", - "../../IPChainStakeMirror.sol", - "../../IGovernanceVotePower.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IIGovernanceVotePower"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@openzeppelin\\contracts\\token\\ERC20\\IERC20.sol": { - "lastModificationDate": 1729942398216, - "contentHash": "df36f7051335cd1e748b1b6463b7fdd3", - "sourceName": "@openzeppelin/contracts/token/ERC20/IERC20.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": ["^0.8.0"], - "artifacts": ["IERC20"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IVPContractEvents.sol": { - "lastModificationDate": 1729942398470, - "contentHash": "45b7fa7ca08b377cbfe56b63cd9fe1fc", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IVPContractEvents.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IVPContractEvents"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IPChainVotePower.sol": { - "lastModificationDate": 1729942397628, - "contentHash": "fa3b7e12958a56a0033111d50871d2d3", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IPChainVotePower.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IPChainVotePower"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IDelegationAccount.sol": { - "lastModificationDate": 1729942387760, - "contentHash": "27416a0bee8c858e1c987131f3406559", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IDelegationAccount.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IClaimSetupManager.sol", - "@openzeppelin/contracts/token/ERC20/IERC20.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IDelegationAccount"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IRandomProvider.sol": { - "lastModificationDate": 1729942397756, - "contentHash": "149e1936b7fe8dc470542410f3a980c2", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IRandomProvider.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IRandomProvider"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IIncreaseManager.sol": { - "lastModificationDate": 1729942396599, - "contentHash": "47af84282709dcad4ba3c29102ce7e4d", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IIncreaseManager.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IIncreaseManager"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@flarenetwork\\flare-periphery-contracts\\coston2\\IRNatAccount.sol": { - "lastModificationDate": 1729942398033, - "contentHash": "c7f1c6d9a925305340a5c0b379afab58", - "sourceName": "@flarenetwork/flare-periphery-contracts/coston2/IRNatAccount.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": [ - "./IRNat.sol", - "@openzeppelin/contracts/token/ERC20/IERC20.sol" - ], - "versionPragmas": [">=0.7.6 <0.9"], - "artifacts": ["IRNatAccount"] - }, - "C:\\Users\\ayush\\OneDrive\\Desktop\\encode\\node_modules\\@openzeppelin\\contracts\\token\\ERC20\\extensions\\IERC20Metadata.sol": { - "lastModificationDate": 1729942398281, - "contentHash": "909ab67fc5c25033fe6cd364f8c056f9", - "sourceName": "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol", - "solcConfig": { - "version": "0.8.17", - "settings": { - "optimizer": { - "enabled": false, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": ["ast"] - } - } - } - }, - "imports": ["../IERC20.sol"], - "versionPragmas": ["^0.8.0"], - "artifacts": ["IERC20Metadata"] - } - } -} diff --git a/contracts/EventManager.sol b/contracts/EventManager.sol index dfda48a..b5c3a38 100644 --- a/contracts/EventManager.sol +++ b/contracts/EventManager.sol @@ -2,182 +2,254 @@ pragma solidity >=0.8.2 <0.9.0; -import {ContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol"; +import {ContractRegistry} from '@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol'; /* THIS IS A TEST IMPORT, in production use: import {FtsoV2Interface} from "@flarenetwork/flare-periphery-contracts/coston2/FtsoV2Interface.sol"; */ -import {TestFtsoV2Interface} from "@flarenetwork/flare-periphery-contracts/coston2/TestFtsoV2Interface.sol"; +import {TestFtsoV2Interface} from '@flarenetwork/flare-periphery-contracts/coston2/TestFtsoV2Interface.sol'; contract EventManager { + TestFtsoV2Interface internal ftsoV2; + bytes21[] public feedIds = [ + bytes21(0x01464c522f55534400000000000000000000000000) // FLR/USD + // bytes21(0x014254432f55534400000000000000000000000000), // BTC/USD + // bytes21(0x014554482f55534400000000000000000000000000) // ETH/USD + ]; - struct Event { - string name; - string description; - uint256 capacity; - uint256 ticketsSold; - uint256 ticketPrice; // in USD cents - uint256 eventDate; - string[] images; // array of image URLs - uint256[] tickets; - address payable eventHost; + constructor() { + /* THIS IS A TEST METHOD, in production use: ftsoV2 = ContractRegistry.getFtsoV2(); */ + ftsoV2 = ContractRegistry.getTestFtsoV2(); + } + + struct Event { + string name; + string description; + uint256 capacity; + uint256 ticketsSold; + uint256 ticketPrice; // in USD cents + uint256 eventDate; + string[] images; // array of image URLs + uint256[] tickets; + address payable eventHost; + } + + struct Ticket { + address holder; + uint256 boughtTime; + uint256 eventId; + } + + event EventCreated(uint256 eventId, string name, uint256 eventDate); + event TicketPurchased( + uint256 ticketId, + uint256 eventId, + address buyer, + uint256 price + ); + event TicketTransferred(uint256 ticketId, address from, address to); + event TicketTransferApproved( + uint256 ticketId, + address owner, + address trustee + ); + + mapping(uint256 => Event) public events; + mapping(uint256 => Ticket) public tickets; + + mapping(uint256 => mapping(address => bool)) ticketAllowance; + + mapping(address => uint256[]) public userTickets; + + uint256 public eventCounter; + uint256 public ticketCounter; + + function getFtsoV2CurrentFeedValues() + public + view + returns ( + uint256[] memory _feedValues, + int8[] memory _decimals, + uint64 _timestamp + ) + { + return ftsoV2.getFeedsById(feedIds); + } + + function getFlareFeed() + public + view + returns (uint256 _feedValue, int8 _decimals, uint64 _timestamp) + { + uint256[] memory feedValues; + int8[] memory decimals; + uint64 timestamp; + (feedValues, decimals, timestamp) = ftsoV2.getFeedsById(feedIds); + return (feedValues[0], decimals[0], timestamp); + } + + function centsToFlare(uint256 _cents) public view returns (uint256 _flr) { + uint256 feedValue; + int8 decimals; + (feedValue, decimals, ) = getFlareFeed(); + return (_cents * power(10, decimals) * 1 ether) / 100 / feedValue; + } + + function power(uint base, int8 exponent) private pure returns (uint) { + require(exponent >= 0, 'Exponent must be non-negative'); + uint result = 1; + for (int8 i = 0; i < exponent; i++) { + result *= base; + } + return result; + } + + function getEventPriceFlare( + uint256 _eventId + ) public view returns (uint256 _flr) { + require(_eventId < eventCounter, 'Invalid event ID'); + return centsToFlare(events[_eventId].ticketPrice); + } + + function createEvent( + string memory _name, + string memory _description, + uint256 _capacity, + uint256 _ticketPrice, + uint256 _eventDate, + string[] memory _images + ) public returns (uint256 _eventId) { + events[eventCounter] = Event( + _name, + _description, + _capacity, + 0, + _ticketPrice, + _eventDate, + _images, + new uint256[](0), + payable(msg.sender) + ); + eventCounter++; + emit EventCreated(eventCounter - 1, _name, _eventDate); + return eventCounter - 1; + } + + function getEventImages( + uint256 _eventId + ) public view returns (string[] memory) { + require(_eventId < eventCounter, 'Invalid event ID'); + return events[_eventId].images; + } + + function getEventTickets( + uint256 _eventId + ) public view returns (uint256[] memory) { + require(_eventId < eventCounter, 'Invalid event ID'); + return events[_eventId].tickets; + } + + function buyTicket( + uint256 _eventId + ) public payable returns (uint256 _ticketId) { + require(_eventId < eventCounter, 'Invalid event ID'); + require( + events[_eventId].eventDate > block.timestamp, + 'Event has already passed' + ); + require( + events[_eventId].tickets.length < events[_eventId].capacity, + 'Event is full' + ); + + uint256 ticketCost = getEventPriceFlare(_eventId); // Get ticket price in FLR + require(msg.value >= ticketCost, 'Insufficient value provided'); // Ensure user has paid >= ticket price + if (msg.value > ticketCost) { + // Pay any excess the user paid + (bool sentExcess, ) = msg.sender.call{value: msg.value - ticketCost}(''); + require(sentExcess, 'Failed to send FLR excess back to buyer'); } - struct Ticket { - address holder; - uint256 boughtTime; - uint256 eventId; + // Create new ticket + tickets[ticketCounter] = Ticket(msg.sender, block.timestamp, _eventId); + + // Add ticket to user + userTickets[msg.sender].push(ticketCounter); + + ticketCounter++; + + // Update number of tickets sold + events[_eventId].tickets.push(ticketCounter - 1); + events[_eventId].ticketsSold++; + + // Transfer FLR to event host + (bool sentToHost, ) = events[_eventId].eventHost.call{value: ticketCost}( + '' + ); + require(sentToHost, 'Failed to send FLR to event host'); + + emit TicketPurchased(ticketCounter - 1, _eventId, msg.sender, ticketCost); + return ticketCounter - 1; + } + + function transferTicketForce(uint256 _ticketId, address _to) private { + require(_ticketId < ticketCounter, 'Invalid ticket ID'); + require( + events[tickets[_ticketId].eventId].eventDate > block.timestamp, + 'Event has already passed' + ); + + address prevHolder = tickets[_ticketId].holder; + + // Get index of ticket in holder's array + bool found = false; + uint256 i = 0; + for (; i < userTickets[prevHolder].length; i++) { + if (userTickets[prevHolder][i] == _ticketId) { + found = true; + break; + } } - event EventCreated(uint256 eventId, string name, uint256 eventDate); - event TicketPurchased(uint256 ticketId, uint256 eventId, address buyer, uint256 price); - event TicketTransferred(uint256 ticketId, address from, address to); - event TicketTransferApproved(uint256 ticketId, address owner, address trustee); + require(found, "Ticket not found in sender's inventory"); - mapping(uint256 => Event) public events; - mapping(uint256 => Ticket) public tickets; - - mapping(uint256 => mapping(address => bool)) ticketAllowance; - - mapping(address => uint256[]) public userTickets; - - uint256 public eventCounter; - uint256 public ticketCounter; - - function getFtsoV2CurrentFeedValues() public view returns ( - uint256[] memory _feedValues, - int8[] memory _decimals, - uint64 _timestamp - ) { - return ftsoV2.getFeedsById(feedIds); + // Remove ticket from holder's array + for (; i < userTickets[prevHolder].length - 1; i++) { + userTickets[prevHolder][i] = userTickets[prevHolder][i + 1]; } + userTickets[prevHolder].pop(); - function getFlareFeed() public view returns (uint256 _feedValue, int8 _decimals, uint64 _timestamp) { - uint256[] memory feedValues; - int8[] memory decimals; - uint64 timestamp; - (feedValues, decimals, timestamp) = ftsoV2.getFeedsById(feedIds); - return (feedValues[0], decimals[0], timestamp); - } + // Add ticket to _to's array + userTickets[_to].push(_ticketId); - function centsToFlare(uint256 _cents) public view returns (uint256 _flr) { - uint256 feedValue; - int8 decimals; - (feedValue, decimals, ) = getFlareFeed(); - return _cents * power(10, decimals) * 1 ether / 100 / feedValue; - } + tickets[_ticketId].holder = _to; - function power(uint base, int8 exponent) private pure returns (uint) { - require(exponent >= 0, "Exponent must be non-negative"); - uint result = 1; - for (int8 i = 0; i < exponent; i++) { - result *= base; - } - return result; - } + emit TicketTransferred(_ticketId, prevHolder, _to); + } - function getEventPriceFlare(uint256 _eventId) public view returns (uint256 _flr) { - require(_eventId < eventCounter, "Invalid event ID"); - return centsToFlare(events[_eventId].ticketPrice); - } + function approveTicket(uint256 _ticketId, address _to, bool _allowed) public { + require(_ticketId < ticketCounter, 'Invalid ticket ID'); + require( + tickets[_ticketId].holder == msg.sender, + 'You do not own this ticket' + ); + ticketAllowance[_ticketId][_to] = _allowed; - function createEvent(string memory _name, string memory _description, uint256 _capacity, uint256 _ticketPrice, uint256 _eventDate, string[] memory _images) public returns (uint256 _eventId) { - events[eventCounter] = Event(_name, _description, _capacity, 0, _ticketPrice, _eventDate, _images, new uint256[](0), payable(msg.sender)); - eventCounter++; - emit EventCreated(eventCounter - 1, _name, _eventDate); - return eventCounter - 1; - } + emit TicketTransferApproved(_ticketId, msg.sender, _to); + } - function getEventImages(uint256 _eventId) public view returns (string[] memory) { - require(_eventId < eventCounter, "Invalid event ID"); - return events[_eventId].images; - } + function transferTicketFrom(uint256 _ticketId, address _to) public { + require( + ticketAllowance[_ticketId][msg.sender], + 'You are not allowed to transfer this ticket' + ); + ticketAllowance[_ticketId][msg.sender] = false; + transferTicketForce(_ticketId, _to); + } - function getEventTickets(uint256 _eventId) public view returns (uint256[] memory) { - require(_eventId < eventCounter, "Invalid event ID"); - return events[_eventId].tickets; - } - - function buyTicket(uint256 _eventId) public payable returns (uint256 _ticketId) { - require(_eventId < eventCounter, "Invalid event ID"); - require(events[_eventId].eventDate > block.timestamp, "Event has already passed"); - require(events[_eventId].tickets.length < events[_eventId].capacity, "Event is full"); - - uint256 ticketCost = getEventPriceFlare(_eventId); // Get ticket price in FLR - require(msg.value >= ticketCost, "Insufficient value provided"); // Ensure user has paid >= ticket price - if (msg.value > ticketCost) { - // Pay any excess the user paid - (bool sentExcess, ) = msg.sender.call{value: msg.value - ticketCost}(""); - require(sentExcess, "Failed to send FLR excess back to buyer"); - } - - // Create new ticket - tickets[ticketCounter] = Ticket(msg.sender, block.timestamp, _eventId); - - // Add ticket to user - userTickets[msg.sender].push(ticketCounter); - - ticketCounter++; - - // Update number of tickets sold - events[_eventId].tickets.push(ticketCounter - 1); - events[_eventId].ticketsSold++; - - // Transfer FLR to event host - (bool sentToHost, ) = events[_eventId].eventHost.call{value: ticketCost}(""); - require(sentToHost, "Failed to send FLR to event host"); - - emit TicketPurchased(ticketCounter - 1, _eventId, msg.sender, ticketCost); - return ticketCounter - 1; - } - - function transferTicketForce(uint256 _ticketId, address _to) private { - require(_ticketId < ticketCounter, "Invalid ticket ID"); - require(events[tickets[_ticketId].eventId].eventDate > block.timestamp, "Event has already passed"); - - address prevHolder = tickets[_ticketId].holder; - - // Get index of ticket in holder's array - bool found = false; - uint256 i = 0; - for (; i < userTickets[prevHolder].length; i++) { - if (userTickets[prevHolder][i] == _ticketId) { - found = true; - break; - } - } - - require(found, "Ticket not found in sender's inventory"); - - // Remove ticket from holder's array - for (; i < userTickets[prevHolder].length-1; i++) { - userTickets[prevHolder][i] = userTickets[prevHolder][i+1]; - } - userTickets[prevHolder].pop(); - - // Add ticket to _to's array - userTickets[_to].push(_ticketId); - - tickets[_ticketId].holder = _to; - - emit TicketTransferred(_ticketId, prevHolder, _to); - } - - function approveTicket(uint256 _ticketId, address _to, bool _allowed) public { - require(_ticketId < ticketCounter, "Invalid ticket ID"); - require(tickets[_ticketId].holder == msg.sender, "You do not own this ticket"); - ticketAllowance[_ticketId][_to] = _allowed; - - emit TicketTransferApproved(_ticketId, msg.sender, _to); - } - - function transferTicketFrom(uint256 _ticketId, address _to) public { - require(ticketAllowance[_ticketId][msg.sender], "You are not allowed to transfer this ticket"); - ticketAllowance[_ticketId][msg.sender] = false; - transferTicketForce(_ticketId, _to); - } - - function transferTicket(uint256 _ticketId, address _to) public { - require(_ticketId < ticketCounter, "Invalid ticket ID"); - require(tickets[_ticketId].holder == msg.sender, "You do not own this ticket"); - transferTicketForce(_ticketId, _to); - } - -} \ No newline at end of file + function transferTicket(uint256 _ticketId, address _to) public { + require(_ticketId < ticketCounter, 'Invalid ticket ID'); + require( + tickets[_ticketId].holder == msg.sender, + 'You do not own this ticket' + ); + transferTicketForce(_ticketId, _to); + } +}