├── .env.sample ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── chore.md │ ├── doc_issue.md │ ├── feature_request.md │ ├── release_discussion.md │ └── support_request.md ├── PULL_REQUEST_TEMPLATE │ ├── bug_fix.md │ ├── new_feature.md │ ├── new_release.md │ ├── refactor_request.md │ ├── update_ci.md │ └── update_docs.md ├── pull_request_template.md └── workflows │ ├── ci.yml │ └── review_workflow.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── deployments └── 111.json ├── foundry.toml ├── mc.toml ├── package.json ├── remappings.txt ├── script ├── DeployLib.sol ├── DeployStdDictionary.s.sol └── DeployStdFunctions.s.sol ├── site ├── .gitignore ├── README.md ├── babel.config.js ├── biome.json ├── bun.lockb ├── docs │ ├── 00-getting-started.md │ ├── 01-concepts │ │ ├── 01-what-is-meta-contract.md │ │ ├── 02-key-concepts.md │ │ ├── 03-glossary.md │ │ └── index.md │ ├── 02-guides │ │ ├── 01-setup │ │ │ ├── 01-installation.md │ │ │ ├── 02-basic-setup.md │ │ │ └── index.md │ │ ├── 02-development │ │ │ ├── 01-resources.md │ │ │ ├── 02-tdd.md │ │ │ ├── 03-std-functions │ │ │ │ ├── 01-common │ │ │ │ │ ├── 01-access-control │ │ │ │ │ │ └── index.md │ │ │ │ │ └── index.md │ │ │ │ ├── 02-deliberation │ │ │ │ │ └── index.md │ │ │ │ ├── 03-token │ │ │ │ │ └── index.md │ │ │ │ ├── 04-defi │ │ │ │ │ └── index.md │ │ │ │ ├── 05-std │ │ │ │ │ ├── functions │ │ │ │ │ │ ├── Clone.sol │ │ │ │ │ │ │ ├── contract.Clone.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ ├── Create.sol │ │ │ │ │ │ │ ├── contract.Create.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ ├── GetFunctions.sol │ │ │ │ │ │ │ ├── contract.GetFunctions.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ ├── Receive.sol │ │ │ │ │ │ │ ├── contract.Receive.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ ├── internal │ │ │ │ │ │ │ ├── ProxyCreator.sol │ │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ │ └── library.ProxyCreator.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ └── protected │ │ │ │ │ │ │ ├── FeatureToggle.sol │ │ │ │ │ │ │ ├── contract.FeatureToggle.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ │ ├── InitSetAdmin.sol │ │ │ │ │ │ │ ├── contract.InitSetAdmin.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ │ ├── UpgradeDictionary.sol │ │ │ │ │ │ │ ├── contract.UpgradeDictionary.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ └── protection │ │ │ │ │ │ │ ├── FeatureToggle.sol │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ └── library.FeatureToggle.md │ │ │ │ │ │ │ ├── Initialization.sol │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ └── library.Initialization.md │ │ │ │ │ │ │ ├── MsgSender.sol │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ └── library.MsgSender.md │ │ │ │ │ │ │ ├── ProtectionBase.sol │ │ │ │ │ │ │ ├── abstract.ProtectionBase.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ ├── index.md │ │ │ │ │ ├── interfaces │ │ │ │ │ │ ├── IStd.sol │ │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ │ └── interface.IStd.md │ │ │ │ │ │ ├── StdFacade.sol │ │ │ │ │ │ │ ├── contract.StdFacade.md │ │ │ │ │ │ │ └── index.md │ │ │ │ │ │ └── index.md │ │ │ │ │ └── storage │ │ │ │ │ │ ├── Schema.sol │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ └── interface.Schema.md │ │ │ │ │ │ ├── Storage.sol │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ └── library.Storage.md │ │ │ │ │ │ └── index.md │ │ │ │ └── index.md │ │ │ ├── 04-using-internal-library.md │ │ │ └── index.md │ │ ├── 03-operations │ │ │ ├── 01-deployment.md │ │ │ ├── 02-contract-verification.md │ │ │ ├── 03-upgrades.md │ │ │ ├── 04-ci-cd.md │ │ │ └── index.md │ │ ├── 04-middlewares │ │ │ ├── 01-the-graph.md │ │ │ └── index.md │ │ ├── 05-project-management │ │ │ ├── 01-documentation-guidelines.md │ │ │ ├── 02-branching-and-release-strategy.md │ │ │ ├── 03-coding-standards.md │ │ │ ├── 04-test-strategy.md │ │ │ └── index.md │ │ └── index.md │ ├── 03-api │ │ ├── 01-overview.md │ │ ├── 02-usage.md │ │ ├── 03-api-details │ │ │ ├── Flattened.sol │ │ │ │ ├── abstract.CommonBase.md │ │ │ │ ├── abstract.Context.md │ │ │ │ ├── abstract.DictionaryBase.md │ │ │ │ ├── abstract.MCBase.md │ │ │ │ ├── abstract.MCScript.md │ │ │ │ ├── abstract.MCScriptBase.md │ │ │ │ ├── abstract.MCTest.md │ │ │ │ ├── abstract.MCTestBase.md │ │ │ │ ├── abstract.Ownable.md │ │ │ │ ├── abstract.ProtectionBase.md │ │ │ │ ├── abstract.Proxy_0.md │ │ │ │ ├── abstract.Script.md │ │ │ │ ├── abstract.ScriptBase.md │ │ │ │ ├── abstract.StdAssertions.md │ │ │ │ ├── abstract.StdChains.md │ │ │ │ ├── abstract.StdCheats.md │ │ │ │ ├── abstract.StdCheatsSafe.md │ │ │ │ ├── abstract.StdInvariant.md │ │ │ │ ├── abstract.StdUtils.md │ │ │ │ ├── abstract.Test.md │ │ │ │ ├── abstract.TestBase.md │ │ │ │ ├── constants.Flattened.md │ │ │ │ ├── contract.BeaconDictionary.md │ │ │ │ ├── contract.Clone.md │ │ │ │ ├── contract.Dictionary_0.md │ │ │ │ ├── contract.DummyContract.md │ │ │ │ ├── contract.DummyFacade.md │ │ │ │ ├── contract.DummyFunction.md │ │ │ │ ├── contract.FeatureToggle.md │ │ │ │ ├── contract.GetFunctions.md │ │ │ │ ├── contract.ImmutableDictionary.md │ │ │ │ ├── contract.InitSetAdmin.md │ │ │ │ ├── contract.MockDictionary.md │ │ │ │ ├── contract.MockERC20.md │ │ │ │ ├── contract.MockERC721.md │ │ │ │ ├── contract.Proxy_1.md │ │ │ │ ├── contract.Receive.md │ │ │ │ ├── contract.SimpleMockProxy.md │ │ │ │ ├── contract.StdFacade.md │ │ │ │ ├── contract.UpgradeDictionary.md │ │ │ │ ├── contract.UpgradeableBeacon.md │ │ │ │ ├── enum.DictionaryKind.md │ │ │ │ ├── enum.ProxyKind.md │ │ │ │ ├── enum.TypeStatus.md │ │ │ │ ├── function.loadAddressFrom.md │ │ │ │ ├── function.param_0.md │ │ │ │ ├── function.param_1.md │ │ │ │ ├── function.param_10.md │ │ │ │ ├── function.param_11.md │ │ │ │ ├── function.param_12.md │ │ │ │ ├── function.param_13.md │ │ │ │ ├── function.param_14.md │ │ │ │ ├── function.param_15.md │ │ │ │ ├── function.param_16.md │ │ │ │ ├── function.param_17.md │ │ │ │ ├── function.param_18.md │ │ │ │ ├── function.param_19.md │ │ │ │ ├── function.param_2.md │ │ │ │ ├── function.param_20.md │ │ │ │ ├── function.param_21.md │ │ │ │ ├── function.param_22.md │ │ │ │ ├── function.param_23.md │ │ │ │ ├── function.param_24.md │ │ │ │ ├── function.param_25.md │ │ │ │ ├── function.param_26.md │ │ │ │ ├── function.param_27.md │ │ │ │ ├── function.param_3.md │ │ │ │ ├── function.param_4.md │ │ │ │ ├── function.param_5.md │ │ │ │ ├── function.param_6.md │ │ │ │ ├── function.param_7.md │ │ │ │ ├── function.param_8.md │ │ │ │ ├── function.param_9.md │ │ │ │ ├── index.md │ │ │ │ ├── interface.IBeacon.md │ │ │ │ ├── interface.IDictionary.md │ │ │ │ ├── interface.IDictionaryCore.md │ │ │ │ ├── interface.IERC165_0.md │ │ │ │ ├── interface.IERC165_1.md │ │ │ │ ├── interface.IERC20.md │ │ │ │ ├── interface.IERC721.md │ │ │ │ ├── interface.IERC721Enumerable.md │ │ │ │ ├── interface.IERC721Metadata.md │ │ │ │ ├── interface.IERC721TokenReceiver.md │ │ │ │ ├── interface.IMulticall3.md │ │ │ │ ├── interface.IProxy.md │ │ │ │ ├── interface.IStd.md │ │ │ │ ├── interface.IVerifiable.md │ │ │ │ ├── interface.Schema.md │ │ │ │ ├── interface.Vm.md │ │ │ │ ├── interface.VmSafe.md │ │ │ │ ├── library.Address.md │ │ │ │ ├── library.BundleLib.md │ │ │ │ ├── library.BundleRegistryLib.md │ │ │ │ ├── library.ConfigLib.md │ │ │ │ ├── library.CurrentLib.md │ │ │ │ ├── library.DictionaryLib.md │ │ │ │ ├── library.DictionaryRegistryLib.md │ │ │ │ ├── library.Dummy.md │ │ │ │ ├── library.ERC1967Utils.md │ │ │ │ ├── library.ForgeHelper.md │ │ │ │ ├── library.Formatter.md │ │ │ │ ├── library.FunctionLib.md │ │ │ │ ├── library.FunctionRegistryLib.md │ │ │ │ ├── library.Initialization.md │ │ │ │ ├── library.Inspector.md │ │ │ │ ├── library.Logger.md │ │ │ │ ├── library.MCDeployLib.md │ │ │ │ ├── library.MCFinderLib.md │ │ │ │ ├── library.MCHelpers.md │ │ │ │ ├── library.MCInitLib.md │ │ │ │ ├── library.MCMockLib.md │ │ │ │ ├── library.MessageBody.md │ │ │ │ ├── library.MessageHead.md │ │ │ │ ├── library.MsgSender.md │ │ │ │ ├── library.NameGenerator.md │ │ │ │ ├── library.Parser.md │ │ │ │ ├── library.ProxyCreator.md │ │ │ │ ├── library.ProxyLib.md │ │ │ │ ├── library.ProxyRegistryLib.md │ │ │ │ ├── library.ProxyUtils.md │ │ │ │ ├── library.SimpleMockProxyLib.md │ │ │ │ ├── library.StdFunctionsArgs.md │ │ │ │ ├── library.StdFunctionsLib.md │ │ │ │ ├── library.StdRegistryLib.md │ │ │ │ ├── library.StdStyle.md │ │ │ │ ├── library.Storage.md │ │ │ │ ├── library.StorageSlot.md │ │ │ │ ├── library.System.md │ │ │ │ ├── library.Tracer.md │ │ │ │ ├── library.TypeGuard.md │ │ │ │ ├── library.Validator.md │ │ │ │ ├── library.console.md │ │ │ │ ├── library.safeconsole.md │ │ │ │ ├── library.stdError.md │ │ │ │ ├── library.stdJson.md │ │ │ │ ├── library.stdMath.md │ │ │ │ ├── library.stdStorage.md │ │ │ │ ├── library.stdStorageSafe.md │ │ │ │ ├── library.stdToml.md │ │ │ │ ├── struct.Bundle.md │ │ │ │ ├── struct.BundleRegistry.md │ │ │ │ ├── struct.ConfigState.md │ │ │ │ ├── struct.Current.md │ │ │ │ ├── struct.DictionaryRegistry.md │ │ │ │ ├── struct.Dictionary_1.md │ │ │ │ ├── struct.FindData.md │ │ │ │ ├── struct.Function.md │ │ │ │ ├── struct.FunctionRegistry.md │ │ │ │ ├── struct.MCDevKit.md │ │ │ │ ├── struct.NamingConfig.md │ │ │ │ ├── struct.Process.md │ │ │ │ ├── struct.ProxyRegistry.md │ │ │ │ ├── struct.Proxy_2.md │ │ │ │ ├── struct.SetupConfig.md │ │ │ │ ├── struct.StdFunctions.md │ │ │ │ ├── struct.StdRegistry.md │ │ │ │ ├── struct.StdStorage.md │ │ │ │ ├── struct.SystemConfig.md │ │ │ │ └── struct.Trace.md │ │ │ ├── MCBase.sol │ │ │ │ ├── abstract.MCBase.md │ │ │ │ ├── abstract.MCScriptBase.md │ │ │ │ ├── abstract.MCTestBase.md │ │ │ │ └── index.md │ │ │ ├── MCDevKit.sol │ │ │ │ ├── index.md │ │ │ │ └── struct.MCDevKit.md │ │ │ ├── MCScript.sol │ │ │ │ ├── abstract.MCScript.md │ │ │ │ └── index.md │ │ │ ├── MCTest.sol │ │ │ │ ├── abstract.MCTest.md │ │ │ │ └── index.md │ │ │ ├── core │ │ │ │ ├── Bundle.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.BundleLib.md │ │ │ │ │ └── struct.Bundle.md │ │ │ │ ├── Dictionary.sol │ │ │ │ │ ├── enum.DictionaryKind.md │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.DictionaryLib.md │ │ │ │ │ └── struct.Dictionary.md │ │ │ │ ├── Function.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.FunctionLib.md │ │ │ │ │ └── struct.Function.md │ │ │ │ ├── Proxy.sol │ │ │ │ │ ├── enum.ProxyKind.md │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.ProxyLib.md │ │ │ │ │ └── struct.Proxy.md │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ ├── registry │ │ │ │ ├── BundleRegistry.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.BundleRegistryLib.md │ │ │ │ │ └── struct.BundleRegistry.md │ │ │ │ ├── DictionaryRegistry.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.DictionaryRegistryLib.md │ │ │ │ │ └── struct.DictionaryRegistry.md │ │ │ │ ├── FunctionRegistry.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.FunctionRegistryLib.md │ │ │ │ │ └── struct.FunctionRegistry.md │ │ │ │ ├── ProxyRegistry.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.ProxyRegistryLib.md │ │ │ │ │ └── struct.ProxyRegistry.md │ │ │ │ ├── StdFunctions.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.StdFunctionsLib.md │ │ │ │ │ └── struct.StdFunctions.md │ │ │ │ ├── StdRegistry.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.StdFunctionsArgs.md │ │ │ │ │ ├── library.StdRegistryLib.md │ │ │ │ │ └── struct.StdRegistry.md │ │ │ │ ├── context │ │ │ │ │ ├── Current.sol │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ ├── library.CurrentLib.md │ │ │ │ │ │ └── struct.Current.md │ │ │ │ │ └── index.md │ │ │ │ └── index.md │ │ │ ├── system │ │ │ │ ├── Config.sol │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.ConfigLib.md │ │ │ │ │ ├── struct.ConfigState.md │ │ │ │ │ ├── struct.NamingConfig.md │ │ │ │ │ ├── struct.SetupConfig.md │ │ │ │ │ └── struct.SystemConfig.md │ │ │ │ ├── Logger.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.Logger.md │ │ │ │ ├── System.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.System.md │ │ │ │ ├── Tracer.sol │ │ │ │ │ ├── function.param.md │ │ │ │ │ ├── index.md │ │ │ │ │ ├── library.Tracer.md │ │ │ │ │ ├── struct.Process.md │ │ │ │ │ └── struct.Trace.md │ │ │ │ ├── Validator.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.Validator.md │ │ │ │ ├── index.md │ │ │ │ └── message │ │ │ │ │ ├── DecodeErrorString.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.DecodeErrorString.md │ │ │ │ │ ├── MessageBody.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MessageBody.md │ │ │ │ │ ├── MessageHead.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MessageHead.md │ │ │ │ │ └── index.md │ │ │ ├── test │ │ │ │ ├── dummy │ │ │ │ │ ├── Dummy.sol │ │ │ │ │ │ ├── index.md │ │ │ │ │ │ └── library.Dummy.md │ │ │ │ │ ├── DummyContract.sol │ │ │ │ │ │ ├── contract.DummyContract.md │ │ │ │ │ │ └── index.md │ │ │ │ │ ├── DummyFacade.sol │ │ │ │ │ │ ├── contract.DummyFacade.md │ │ │ │ │ │ └── index.md │ │ │ │ │ ├── DummyFunction.sol │ │ │ │ │ │ ├── contract.DummyFunction.md │ │ │ │ │ │ └── index.md │ │ │ │ │ └── index.md │ │ │ │ ├── index.md │ │ │ │ └── mocks │ │ │ │ │ ├── MockDictionary.sol │ │ │ │ │ ├── contract.MockDictionary.md │ │ │ │ │ └── index.md │ │ │ │ │ ├── SimpleMockProxy.sol │ │ │ │ │ ├── contract.SimpleMockProxy.md │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.SimpleMockProxyLib.md │ │ │ │ │ └── index.md │ │ │ ├── types │ │ │ │ ├── Formatter.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.Formatter.md │ │ │ │ ├── Inspector.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.Inspector.md │ │ │ │ ├── Parser.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.Parser.md │ │ │ │ ├── TypeGuard.sol │ │ │ │ │ ├── enum.TypeStatus.md │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.TypeGuard.md │ │ │ │ └── index.md │ │ │ └── utils │ │ │ │ ├── ForgeHelper.sol │ │ │ │ ├── constants.ForgeHelper.md │ │ │ │ ├── function.loadAddressFrom.md │ │ │ │ ├── index.md │ │ │ │ └── library.ForgeHelper.md │ │ │ │ ├── global │ │ │ │ ├── MCDeployLib.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MCDeployLib.md │ │ │ │ ├── MCFinderLib.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MCFinderLib.md │ │ │ │ ├── MCHelpers.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MCHelpers.md │ │ │ │ ├── MCInitLib.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MCInitLib.md │ │ │ │ ├── MCMockLib.sol │ │ │ │ │ ├── index.md │ │ │ │ │ └── library.MCMockLib.md │ │ │ │ └── index.md │ │ │ │ ├── index.md │ │ │ │ └── mapping │ │ │ │ ├── NameGenerator.sol │ │ │ │ ├── index.md │ │ │ │ └── library.NameGenerator.md │ │ │ │ └── index.md │ │ └── index.md │ └── 04-examples │ │ ├── 01-dao │ │ ├── 01-textdao.md │ │ ├── 02-simple-dao.md │ │ └── index.md │ │ ├── 02-defi │ │ ├── 01-stable-credit.md │ │ ├── 02-simple-dex.md │ │ └── index.md │ │ ├── 03-erc │ │ ├── 01-erc20.md │ │ ├── 02-erc721.md │ │ ├── 03-erc1155.md │ │ ├── 04-erc4337.md │ │ └── index.md │ │ └── index.md ├── docusaurus.config.ts ├── package.json ├── script │ ├── config.ts │ ├── generate_temp_soldocs.sh │ ├── integrate_soldocs.ts │ ├── remove_temp_soldocs.sh │ └── soldocs │ │ ├── generate_and_move_forge_docs.ts │ │ ├── update_links.ts │ │ ├── upsert_index_file.ts │ │ └── utils.ts ├── sidebars.ts ├── src │ ├── css │ │ └── custom.css │ ├── pages │ │ ├── index.module.css │ │ └── index.tsx │ └── theme │ │ └── Navbar │ │ └── index.tsx ├── static │ ├── .nojekyll │ └── img │ │ ├── common │ │ ├── chevron.svg │ │ ├── search-dark.svg │ │ └── search-light.svg │ │ ├── favicon.ico │ │ ├── hero.png │ │ ├── logo.png │ │ └── social │ │ ├── github-black.png │ │ ├── github-white.png │ │ ├── x-black.png │ │ └── x-white.png └── tsconfig.json ├── src ├── devkit │ ├── Files.sol │ ├── Flattened.sol │ ├── MCBase.sol │ ├── MCDevKit.sol │ ├── MCScript.sol │ ├── MCTest.sol │ ├── core │ │ ├── Bundle.sol │ │ ├── Dictionary.sol │ │ ├── Function.sol │ │ └── Proxy.sol │ ├── registry │ │ ├── BundleRegistry.sol │ │ ├── DictionaryRegistry.sol │ │ ├── FunctionRegistry.sol │ │ ├── ProxyRegistry.sol │ │ ├── StdFunctions.sol │ │ ├── StdRegistry.sol │ │ └── context │ │ │ └── Current.sol │ ├── system │ │ ├── Config.sol │ │ ├── Logger.sol │ │ ├── System.sol │ │ ├── Tracer.sol │ │ ├── Validator.sol │ │ └── message │ │ │ ├── MessageBody.sol │ │ │ └── MessageHead.sol │ ├── test │ │ ├── dummy │ │ │ ├── Dummy.sol │ │ │ ├── DummyContract.sol │ │ │ ├── DummyFacade.sol │ │ │ └── DummyFunction.sol │ │ └── mocks │ │ │ ├── MockDictionary.sol │ │ │ └── SimpleMockProxy.sol │ ├── types │ │ ├── Formatter.sol │ │ ├── Inspector.sol │ │ ├── Parser.sol │ │ └── TypeGuard.sol │ └── utils │ │ ├── ForgeHelper.sol │ │ ├── global │ │ ├── MCDeployLib.sol │ │ ├── MCFinderLib.sol │ │ ├── MCHelpers.sol │ │ ├── MCInitLib.sol │ │ └── MCMockLib.sol │ │ └── mapping │ │ └── NameGenerator.sol └── std │ ├── functions │ ├── Clone.sol │ ├── Create.sol │ ├── GetFunctions.sol │ ├── Receive.sol │ ├── internal │ │ └── ProxyCreator.sol │ └── protected │ │ ├── FeatureToggle.sol │ │ ├── InitSetAdmin.sol │ │ ├── UpgradeDictionary.sol │ │ └── protection │ │ ├── FeatureToggle.sol │ │ ├── Initialization.sol │ │ ├── MsgSender.sol │ │ └── ProtectionBase.sol │ ├── interfaces │ ├── IStd.sol │ └── StdFacade.sol │ └── storage │ ├── Schema.sol │ └── Storage.sol └── test ├── devkit ├── MCDeployLib.t.sol ├── MCFinderLib.t.sol ├── MCHelpers.t.sol ├── MCInitLib.t.sol └── MCMockLib.t.sol ├── script └── DeployStdDictionary.t.sol └── std ├── Std.t.sol └── functions ├── Clone.t.sol ├── Create.t.sol ├── GetFunctions.t.sol ├── Receive.t.sol ├── internal └── ProxyCreator.t.sol └── protected ├── InitSetAdmin.t.sol └── protection ├── Initialization.t.sol └── MsgSender.t.sol /.env.sample: -------------------------------------------------------------------------------- 1 | # Signer 2 | DEPLOYER_ADDR= 3 | DEPLOYER_PRIV_KEY= 4 | 5 | # External services 6 | RPC_URL= 7 | VERIFIER= 8 | ETHERSCAN_API_KEY= 9 | 10 | # Deployed contracts 11 | ## Sepolia 12 | PROXY_ETHERSCAN=0xD05e5AF2690593AE5Df0fd6E79232d2052A91fD3 13 | DICTIONARY_UPGRADEABLE= 14 | DEFAULT_DICTIONARY_UPGRADEABLE_ETHERSCAN= 15 | DICTIONARY_UPGRADEABLE_ETHERSCAN=0x98F5125420ee2f86ab754A0DDBC1f3907c939430 16 | DICTIONARY_UPGRADEABLE_ETHERSCAN_IMPL=0x97880A193c6903787F1eC9027Dd183f71967c009 17 | DEFAULT_OPS_FACADE= 18 | INIT_SET_ADMIN_OP=0x247d82435b6Bf7d82b8b6C54208b50C537d47C33 19 | GET_DEPS_OP=0xfeb63CA661446460c11CB3939154eA40DF744551 20 | CLONE_OP= 21 | SET_IMPLEMENTATION_OP=0x94db066cB5ffA2C5B5842e9356F279Bf07Bc40ea 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug to help us improve 4 | title: "[bug] " 5 | labels: "type: bug" 6 | assignees: "" 7 | --- 8 | 9 | ## Description 10 | 11 | A clear and concise description of what the bug is. 12 | 13 | ## Steps to Reproduce 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | ## Expected behavior 21 | 22 | A clear and concise description of what you expected to happen. 23 | 24 | ## Screenshots 25 | 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | ## Versions 29 | - Solc: [e.g. 0.8.24] 30 | - Foundry: [e.g. forge 0.2.0 (617dfc2 2024-03-29T00:21:19.015083000Z)] 31 | 32 | ## Additional context 33 | 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/chore.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Chore" 3 | about: "Request general maintenance tasks for the repository" 4 | title: "[chore] " 5 | labels: "type: chore" 6 | assignees: "" 7 | 8 | --- 9 | 10 | ## Type 11 | 12 | - [ ] Tooling 13 | - [ ] Dependency Management 14 | - [ ] Code Style/Formatting 15 | - [ ] Documentation Update 16 | - [ ] Refactoring 17 | - [ ] Build Process 18 | - [ ] Other 19 | 20 | ## Description 21 | 22 | Provide a clear and concise description of the maintenance task. Explain why this task is necessary and what it aims to achieve. 23 | 24 | ## Tasks 25 | 26 | - [ ] task 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/doc_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation Issue 3 | about: Report an issue or suggest an improvement for the project documentation or its display on the site 4 | title: "[docs] " 5 | labels: "type: documentation" 6 | assignees: "" 7 | --- 8 | 9 | ## Issue Type 10 | 11 | Specify whether the issue is related to the document content or its display on the site. 12 | 13 | - [ ] Document Content 14 | - [ ] Site Display 15 | 16 | ## Location 17 | 18 | Specify the document or section where the issue is found. Provide links if possible. 19 | 20 | - [link to the document] 21 | 22 | ## Description 23 | 24 | A clear and concise description of what the issue is. Include any relevant details or context. 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: "[feature] " 5 | labels: "type: feature" 6 | assignees: "" 7 | --- 8 | 9 | ## Problem 10 | 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | ## Solution 14 | 15 | A clear and concise description of what you want to happen. 16 | 17 | ## Alternatives 18 | 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | ## Additional context 22 | 23 | Add any other context or screenshots about the feature request here. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/release_discussion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New Release Discussion 3 | about: Create a discussion issue for new release 4 | title: "[discussion] vX.X.X Release Planning 🚀" 5 | labels: "type: release, type: discussion, status: in-progress, good first issue" 6 | assignees: "" 7 | --- 8 | 9 | ## Overview 10 | 11 | This discussion thread is to plan the features and bug fixes to be included in the upcoming `release X.X.X`. We aim to gather input from all users and team members to prioritize and finalize the content of this release. 12 | 13 | Please feel free to leave a comment if you have any features you would like to propose for inclusion in this release or if you have identified any bugs that need to be addressed. Include a brief description. If a bug is urgent, consider including it in a hotfix. 14 | 15 | ## Candidates 16 | 17 | ### Feature 18 | 19 | - [link to feature request issue] or [short description] 20 | 21 | ### Bug Fix 22 | 23 | - [link to bug report issue] or [short description] 24 | 25 | ### Chore 26 | 27 | - [link to chore issue] or [short description] 28 | 29 | ## Follow-Up 30 | 31 | We will regularly follow up on this discussion to track progress and ensure that all proposed items are addressed before the release. 32 | 33 | Thank you for your contributions! 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support Request 3 | about: Request support or ask a question 4 | title: "[support] " 5 | labels: "type: support" 6 | assignees: "" 7 | --- 8 | 9 | ## Question 10 | 11 | Please describe your question or the support you need in detail, including any specific issues you are encountering. 12 | 13 | ## Screenshots or code snippets 14 | 15 | If applicable, add screenshots or code snippets (formatted in Markdown) to help explain your question or the issue you're facing. 16 | 17 | ## Environment 18 | 19 | Describe the environment you're using to run the `mc` project to solve the problem or answer your question. 20 | 21 | - OS: [e.g. Windows 10, macOS 11.2] 22 | - Solc: [e.g. 0.8.24] 23 | - Foundry: [e.g. forge 0.2.0 (617dfc2 2024-03-29T00:21:19.015083000Z)] 24 | 25 | ## Additional context 26 | 27 | Add any other context about the problem or question here. 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/bug_fix.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Fix 3 | about: Create a pull request for bug fix 4 | title: "[bug fix] " 5 | labels: "type: bug, status: in-progress" 6 | assignees: "" 7 | --- 8 | 9 | This pull request is to propose a bug fix for the `mc` project. 10 | 11 | ## Bug Description 12 | 13 | - [link to bug report issue] or [short description] 14 | 15 | - **Steps to Reproduce**: List the steps to reproduce the bug. 16 | - **Expected Behavior**: Describe what you expected to happen. 17 | - **Actual Behavior**: Describe what actually happened. 18 | - **Screenshots**: If applicable, please include screenshots that demonstrate the bug. 19 | 20 | (Please include a summary of the changes and which issue to address.) 21 | 22 | ## Checklist 23 | 24 | - [ ] My code follows the style guidelines of this project 25 | - [ ] I have commented my code, particularly in hard-to-understand areas 26 | - [ ] I have made corresponding changes to the documentation 27 | - [ ] My changes generate no new warnings 28 | - [ ] I have added tests that prove my fix works 29 | - [ ] New and existing unit tests pass locally with my changes 30 | 31 | Please review the changes and provide feedback. 32 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/new_feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New Feature 3 | about: Create a pull request for new feature 4 | title: "[feature] " 5 | labels: "type: feature, status: in-progress" 6 | assignees: "" 7 | --- 8 | 9 | This pull request is to propose the new feature of the `mc` project. 10 | 11 | ## Feature Description 12 | 13 | - [link to feature request issue] or [short description] 14 | 15 | (Please include a summary of the changes and which issue to address. Please also include relevant motivation and context. List any dependencies that are required for this change. If applicable, please include screenshots about the feature.) 16 | 17 | ## Checklist 18 | 19 | - [ ] My code follows the style guidelines of this project 20 | - [ ] I have commented my code, particularly in hard-to-understand areas 21 | - [ ] I have made corresponding changes to the documentation 22 | - [ ] My changes generate no new warnings 23 | - [ ] I have added tests that prove my feature works 24 | - [ ] New and existing unit tests pass locally with my changes 25 | 26 | Please review the changes and provide feedback. 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/refactor_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Refactor Request 3 | about: Suggest a code refactor 4 | title: "[refactor] " 5 | labels: "type: refactor" 6 | assignees: "" 7 | --- 8 | 9 | ## Current Code 10 | 11 | Describe the current code that needs refactoring. 12 | 13 | ## Suggested Refactor 14 | 15 | Describe the proposed changes and improvements. 16 | 17 | ## Benefits 18 | 19 | Explain the benefits of the refactor, such as improved readability or performance. 20 | 21 | ## Additional context 22 | 23 | Add any other context or screenshots about the refactor request here. 24 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/update_ci.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Update CI 3 | about: Create a pull request to update the CI/CD configuration 4 | title: "[ci] " 5 | labels: "type: ci, status: in-progress" 6 | assignees: "" 7 | --- 8 | 9 | This pull request is to propose a CI/CD update for the `mc` project. 10 | 11 | ## CI/CD Update 12 | 13 | - [link to CI/CD issue] or [short description] 14 | 15 | Please review the changes and provide feedback. 16 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/update_docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Update Docs 3 | about: Create a pull request to update the documentation 4 | title: "[docs] " 5 | labels: "type: documentation, status: in-progress" 6 | assignees: "" 7 | --- 8 | 9 | This pull request is to propose a documentation update for the `mc` project. 10 | 11 | ## Documentation Update 12 | 13 | - [link to documentation issue] or [short description] 14 | 15 | Please review the changes and provide feedback. 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | - [link to related issue] or [short description] 4 | 5 | (Please include a summary of the changes and which issue to address. Please also include relevant motivation and context. List any dependencies that are required for this change. If applicable, please include screenshots about the feature.) 6 | 7 | ## Checklist 8 | 9 | - [ ] My code follows the style guidelines of this project 10 | - [ ] I have commented my code, particularly in hard-to-understand areas 11 | - [ ] I have made corresponding changes to the documentation 12 | - [ ] My changes generate no new warnings 13 | - [ ] I have added tests that prove my feature works 14 | - [ ] New and existing unit tests pass locally with my changes 15 | 16 | Please review the changes and provide feedback. 17 | -------------------------------------------------------------------------------- /.github/workflows/review_workflow.yml: -------------------------------------------------------------------------------- 1 | name: Review Workflow Changes 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | paths: 7 | - '.github/workflows/**' 8 | 9 | jobs: 10 | review-workflow-changes: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - name: Validate workflow files 15 | run: | 16 | yamllint .github/workflows/ 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiler files 2 | cache/ 3 | out/ 4 | 5 | # Ignores development broadcast logs 6 | !/broadcast 7 | /broadcast/*/31337/ 8 | /broadcast/*/11155111/ 9 | /broadcast/**/dry-run/ 10 | 11 | # Dotenv file 12 | .env 13 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/ucs-contracts"] 5 | path = lib/ucs-contracts 6 | url = https://github.com/ecdysisxyz/ucs-contracts 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["NomicFoundation.hardhat-solidity"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "solidity-language-server.trace.server.verbosity": "verbose", 3 | "solidity.formatter": "forge", 4 | "solidity.telemetry": false, 5 | "editor.formatOnSave": true, 6 | "[solidity]": { 7 | "editor.defaultFormatter": "NomicFoundation.hardhat-solidity" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | The format is based on [Keep a Changelog](https://keepachangelog.com), 4 | and this project adheres to [Semantic Versioning](https://semver.org). 5 | 6 | 7 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Meta Contract 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /deployments/111.json: -------------------------------------------------------------------------------- 1 | { 2 | "InitSetAdmin": { 3 | "v0.1.0": "0xaaa", 4 | "v0.1.1": "0xaab", 5 | "latest": "v0.1.1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 2 | 3 | [profile.default] 4 | src = "src" 5 | out = "out" 6 | libs = ["lib"] 7 | optimizer = false 8 | fs_permissions = [ 9 | { access = "read", path = "./mc.toml" }, 10 | { access = "read", path = "./lib/mc/mc.toml" }, 11 | ] 12 | 13 | [fmt] 14 | ignore = ["**/Flattened.sol"] 15 | -------------------------------------------------------------------------------- /mc.toml: -------------------------------------------------------------------------------- 1 | [setup] 2 | STD_FUNCS = true 3 | 4 | [system] 5 | LOG_LEVEL = "Warn" 6 | SCAN_RANGE = 5 7 | 8 | [naming] 9 | DEFAULT_DICTIONARY = 'Dictionary' 10 | DEFAULT_DICTIONARY_DUPLICATED = 'DuplicatedDictionary' 11 | DEFAULT_DICTIONARY_MOCK = 'MockDictionary' 12 | DEFAULT_PROXY = 'Proxy' 13 | DEFAULT_PROXY_MOCK = 'MockProxy' 14 | DEFAULT_BUNDLE = 'Bundle' 15 | DEFAULT_FUNCTION = 'Function' 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mc", 3 | "workspaces": ["site/*"], 4 | "scripts": { 5 | "site:install": "cd site && bun install", 6 | "site:start": "cd site && npm run start", 7 | "site:build": "cd site && npm run build", 8 | "site:serve": "cd site && npm run serve", 9 | "site:clear": "cd site && npm run clear", 10 | "site:soldocs": "cd site && npm run soldocs" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | @mc/=src/ 2 | @mc-std/=src/std/ 3 | @mc-devkit/=src/devkit/ 4 | @ucs.mc/=lib/ucs-contracts/src/ 5 | @oz.mc/=lib/ucs-contracts/lib/openzeppelin-contracts/contracts/ 6 | -------------------------------------------------------------------------------- /script/DeployLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCDevKit} from "@mc-devkit/Flattened.sol"; 5 | import {StdFacade} from "@mc-std/interfaces/StdFacade.sol"; 6 | import {InitSetAdmin} from "@mc-std/functions/protected/InitSetAdmin.sol"; 7 | 8 | library DeployLib { 9 | using DeployLib for MCDevKit; 10 | 11 | string internal constant BUNDLE_NAME = "Std"; 12 | 13 | function deployStd(MCDevKit storage mc, address admin) internal returns (address) { 14 | for (uint256 i; i < mc.std.all.functions.length; ++i) { 15 | mc.use(mc.std.all.functions[i]); 16 | } 17 | mc.useFacade(address(new StdFacade())); 18 | bytes memory initData = abi.encodeCall(InitSetAdmin.initSetAdmin, admin); 19 | return mc.deploy(initData).toProxyAddress(); 20 | } 21 | 22 | function deployStdFunctions(MCDevKit storage mc) internal returns (MCDevKit storage) { 23 | mc.std.functions.deployIfNotExists(); 24 | return mc; 25 | } 26 | 27 | function deployStdDictionary(MCDevKit storage mc) internal returns (MCDevKit storage) { 28 | mc.std.complete(); 29 | mc.deployDictionary(mc.std.all); 30 | return mc; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /script/DeployStdDictionary.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCScriptBase, MCDevKit} from "@mc-devkit/Flattened.sol"; 5 | import {DeployLib} from "./DeployLib.sol"; 6 | 7 | contract DeployStdDictionary is MCScriptBase { 8 | using DeployLib for MCDevKit; 9 | 10 | function setUp() public { 11 | mc.std.functions.fetch(); 12 | } 13 | 14 | function run() public startBroadcastWith("DEPLOYER_PRIV_KEY") { 15 | mc.deployStdDictionary(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /script/DeployStdFunctions.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCScriptBase, MCDevKit} from "@mc-devkit/Flattened.sol"; 5 | import {DeployLib} from "./DeployLib.sol"; 6 | 7 | contract DeployStdFunctions is MCScriptBase { 8 | using DeployLib for MCDevKit; 9 | 10 | function setUp() public { 11 | mc.std.functions.fetch(); 12 | } 13 | 14 | function run() public startBroadcastWith("DEPLOYER_PRIV_KEY") { 15 | mc.deployStdFunctions(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /site/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")], 3 | }; 4 | -------------------------------------------------------------------------------- /site/biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "formatter": { 3 | "enabled": true, 4 | "indentStyle": "space", 5 | "lineWidth": 120 6 | }, 7 | "linter": { 8 | "enabled": true 9 | }, 10 | "organizeImports": { 11 | "enabled": true 12 | }, 13 | "files": { 14 | "ignore": [".docusaurus/**", "node_modules/**"], 15 | "include": ["./**/*.{js,ts,tsx,json}"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /site/bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/bun.lockb -------------------------------------------------------------------------------- /site/docs/01-concepts/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [meta-contract, introduction, overview, getting-started] 3 | tags: [meta-contract, introduction, overview, getting-started] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Concepts 10 | 11 | This section provides an overview of the Meta Contract project and its fundamental concepts. If you're new to Meta Contract, we recommend starting with "What is Meta Contract?" and then proceeding through the documents in the order listed above. Here you'll find: 12 | 13 | 1. **[What is Meta Contract?](01-what-is-meta-contract.md)**: An introduction to the Meta Contract project and its goals. 14 | 2. **[Key Concepts](02-key-concepts.md)**: Essential concepts and architecture used throughout the Meta Contract ecosystem. 15 | 3. **[Glossary](03-glossary.md)**: A list of terms and concepts used in the Meta Contract documentation. 16 | -------------------------------------------------------------------------------- /site/docs/02-guides/01-setup/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [meta-contract, setup, guide] 3 | tags: [meta-contract, setup, guide] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Setup Guide 10 | 11 | This guide provides a comprehensive overview of the Meta Contract setup process, including installation, configuration. 12 | 13 | 1. **[Installation](./01-installation.md)**: How to install Meta Contract. 14 | 2. **[Basic Setup](./02-basic-setup.md)**: How to configure Meta Contract. 15 | 16 | If you're new to Meta Contract, we recommend starting with "Installation" and then proceeding through the documents in the order listed above. 17 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/01-resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: Useful Resources 3 | keywords: [smart contract development, ethereum, foundry, solidity] 4 | tags: [smart contract development, ethereum, foundry, solidity] 5 | last_update: 6 | date: 2024-10-28 7 | author: Meta Contract Development Team 8 | --- 9 | 10 | # Useful Resources for General Smart Contract Development 11 | 12 | This guide provides useful resources for general smart contract development. 13 | These resources provide a solid foundation for understanding the blockchain ecosystem in which Meta Contract operates. 14 | 15 | ## Ethereum 16 | 17 | - Ethereum Developer Guide https://ethereum.org/en/developers/docs/ 18 | 19 | - EVM 20 | - Basics https://docs.huff.sh/tutorial/evm-basics/ 21 | - Illustrated https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf 22 | - OpCodes https://www.evm.codes/ 23 | 24 | ## Language 25 | 26 | - Solidity https://docs.soliditylang.org/en/latest/ 27 | - The most popular language for developing smart contracts on Ethereum. 28 | - Huff https://docs.huff.sh/ 29 | - A low-level assembly language for the EVM. 30 | 31 | ## Development Tools 32 | 33 | - [Foundry](https://book.getfoundry.sh/) 34 | 35 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/01-common/01-access-control/index.md: -------------------------------------------------------------------------------- 1 | # Access Control 2 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/02-deliberation/index.md: -------------------------------------------------------------------------------- 1 | # Deliberation Functions 2 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/04-defi/index.md: -------------------------------------------------------------------------------- 1 | # DeFi Functions 2 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Clone.sol/contract.Clone.md: -------------------------------------------------------------------------------- 1 | # Clone 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/Clone.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### clone 14 | 15 | DO NOT USE STORAGE DIRECTLY !!! 16 | 17 | 18 | ```solidity 19 | function clone(bytes calldata initData) external returns (address proxy); 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Clone.sol/index.md: -------------------------------------------------------------------------------- 1 | # Clone.sol 2 | 3 | 4 | - [contract.Clone](./contract.Clone.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Create.sol/contract.Create.md: -------------------------------------------------------------------------------- 1 | # Create 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/Create.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### create 14 | 15 | DO NOT USE STORAGE DIRECTLY !!! 16 | 17 | 18 | ```solidity 19 | function create(address dictionary, bytes calldata initData) external returns (address proxy); 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Create.sol/index.md: -------------------------------------------------------------------------------- 1 | # Create.sol 2 | 3 | 4 | - [contract.Create](./contract.Create.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/GetFunctions.sol/contract.GetFunctions.md: -------------------------------------------------------------------------------- 1 | # GetFunctions 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/GetFunctions.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### getFunctions 14 | 15 | 16 | ```solidity 17 | function getFunctions() external view returns (Function[] memory); 18 | ``` 19 | 20 | ## Structs 21 | ### Function 22 | DO NOT USE STORAGE DIRECTLY !!! 23 | 24 | 25 | ```solidity 26 | struct Function { 27 | bytes4 selector; 28 | address implementation; 29 | } 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/GetFunctions.sol/index.md: -------------------------------------------------------------------------------- 1 | # GetFunctions.sol 2 | 3 | 4 | - [contract.GetFunctions](./contract.GetFunctions.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Receive.sol/contract.Receive.md: -------------------------------------------------------------------------------- 1 | # Receive 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/Receive.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### receive 14 | 15 | 16 | ```solidity 17 | receive() external payable; 18 | ``` 19 | 20 | ## Events 21 | ### Received 22 | DO NOT USE STORAGE DIRECTLY !!! 23 | 24 | 25 | ```solidity 26 | event Received(address from, uint256 amount); 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/Receive.sol/index.md: -------------------------------------------------------------------------------- 1 | # Receive.sol 2 | 3 | 4 | - [contract.Receive](./contract.Receive.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/index.md: -------------------------------------------------------------------------------- 1 | # Functions 2 | 3 | 4 | - [internal](./internal/index.md) 5 | - [protected](./protected/index.md) 6 | - [Clone](./Clone.sol/contract.Clone.md) 7 | - [Create](./Create.sol/contract.Create.md) 8 | - [GetFunctions](./GetFunctions.sol/contract.GetFunctions.md) 9 | - [Receive](./Receive.sol/contract.Receive.md) 10 | 11 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/internal/ProxyCreator.sol/index.md: -------------------------------------------------------------------------------- 1 | # ProxyCreator.sol 2 | 3 | 4 | - [library.ProxyCreator](./library.ProxyCreator.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/internal/ProxyCreator.sol/library.ProxyCreator.md: -------------------------------------------------------------------------------- 1 | # ProxyCreator 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/internal/ProxyCreator.sol) 3 | 4 | < MC Standard Helper Library > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### create 14 | 15 | 16 | ```solidity 17 | function create(address dictionary, bytes memory initData) internal returns (address proxy); 18 | ``` 19 | 20 | ## Events 21 | ### ProxyCreated 22 | 23 | ```solidity 24 | event ProxyCreated(address dictionary, address proxy); 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/internal/index.md: -------------------------------------------------------------------------------- 1 | # Internal 2 | 3 | 4 | - [ProxyCreator](./ProxyCreator.sol/library.ProxyCreator.md) 5 | 6 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/FeatureToggle.sol/contract.FeatureToggle.md: -------------------------------------------------------------------------------- 1 | # FeatureToggle 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/FeatureToggle.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - 0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### featureToggle 17 | 18 | DO NOT USE STORAGE DIRECTLY !!! 19 | 20 | 21 | ```solidity 22 | function featureToggle(bytes4 selector) external onlyAdmin; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/FeatureToggle.sol/index.md: -------------------------------------------------------------------------------- 1 | # FeatureToggle.sol 2 | 3 | 4 | - [contract.FeatureToggle](./contract.FeatureToggle.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/InitSetAdmin.sol/contract.InitSetAdmin.md: -------------------------------------------------------------------------------- 1 | # InitSetAdmin 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/InitSetAdmin.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - v0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### initSetAdmin 17 | 18 | 19 | ```solidity 20 | function initSetAdmin(address admin) external initializer; 21 | ``` 22 | 23 | ## Events 24 | ### AdminSet 25 | DO NOT USE STORAGE DIRECTLY !!! 26 | 27 | 28 | ```solidity 29 | event AdminSet(address admin); 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/InitSetAdmin.sol/index.md: -------------------------------------------------------------------------------- 1 | # InitSetAdmin.sol 2 | 3 | 4 | - [contract.InitSetAdmin](./contract.InitSetAdmin.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/UpgradeDictionary.sol/contract.UpgradeDictionary.md: -------------------------------------------------------------------------------- 1 | # UpgradeDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/UpgradeDictionary.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - 0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### upgradeDictionary 17 | 18 | DO NOT USE STORAGE DIRECTLY !!! 19 | 20 | 21 | ```solidity 22 | function upgradeDictionary(address newDictionary) external onlyAdmin; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/UpgradeDictionary.sol/index.md: -------------------------------------------------------------------------------- 1 | # UpgradeDictionary.sol 2 | 3 | 4 | - [contract.UpgradeDictionary](./contract.UpgradeDictionary.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/index.md: -------------------------------------------------------------------------------- 1 | # Protected Functions 2 | 3 | 4 | - [protection](./protection/index.md) 5 | - [FeatureToggle](./FeatureToggle.sol/contract.FeatureToggle.md) 6 | - [InitSetAdmin](./InitSetAdmin.sol/contract.InitSetAdmin.md) 7 | - [UpgradeDictionary](./UpgradeDictionary.sol/contract.UpgradeDictionary.md) 8 | 9 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/FeatureToggle.sol/index.md: -------------------------------------------------------------------------------- 1 | # FeatureToggle.sol 2 | 3 | 4 | - [library.FeatureToggle](./library.FeatureToggle.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/FeatureToggle.sol/library.FeatureToggle.md: -------------------------------------------------------------------------------- 1 | # FeatureToggle 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/protection/FeatureToggle.sol) 3 | 4 | 5 | ## Functions 6 | ### shouldBeActive 7 | 8 | 9 | ```solidity 10 | function shouldBeActive(bytes4 selector) internal view; 11 | ``` 12 | 13 | ## Errors 14 | ### FeatureNotActive 15 | 16 | ```solidity 17 | error FeatureNotActive(); 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/Initialization.sol/index.md: -------------------------------------------------------------------------------- 1 | # Initialization.sol 2 | 3 | 4 | - [library.Initialization](./library.Initialization.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/Initialization.sol/library.Initialization.md: -------------------------------------------------------------------------------- 1 | # Initialization 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/protection/Initialization.sol) 3 | 4 | 5 | ## Functions 6 | ### shouldNotBeCompleted 7 | 8 | 9 | ```solidity 10 | function shouldNotBeCompleted() internal view; 11 | ``` 12 | 13 | ### willBeCompleted 14 | 15 | 16 | ```solidity 17 | function willBeCompleted() internal; 18 | ``` 19 | 20 | ## Events 21 | ### Initialized 22 | 23 | ```solidity 24 | event Initialized(uint64 version); 25 | ``` 26 | 27 | ## Errors 28 | ### InvalidInitialization 29 | 30 | ```solidity 31 | error InvalidInitialization(); 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/MsgSender.sol/index.md: -------------------------------------------------------------------------------- 1 | # MsgSender.sol 2 | 3 | 4 | - [library.MsgSender](./library.MsgSender.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/MsgSender.sol/library.MsgSender.md: -------------------------------------------------------------------------------- 1 | # MsgSender 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/protection/MsgSender.sol) 3 | 4 | 5 | ## Functions 6 | ### shouldBeAdmin 7 | 8 | 9 | ```solidity 10 | function shouldBeAdmin() internal view; 11 | ``` 12 | 13 | ### shouldBeMember 14 | 15 | 16 | ```solidity 17 | function shouldBeMember() internal view; 18 | ``` 19 | 20 | ## Errors 21 | ### NotAdmin 22 | 23 | ```solidity 24 | error NotAdmin(); 25 | ``` 26 | 27 | ### NotMember 28 | 29 | ```solidity 30 | error NotMember(); 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/ProtectionBase.sol/abstract.ProtectionBase.md: -------------------------------------------------------------------------------- 1 | # ProtectionBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/functions/protected/protection/ProtectionBase.sol) 3 | 4 | 5 | ## Functions 6 | ### initializer 7 | 8 | 9 | ```solidity 10 | modifier initializer(); 11 | ``` 12 | 13 | ### onlyAdmin 14 | 15 | 16 | ```solidity 17 | modifier onlyAdmin(); 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/ProtectionBase.sol/index.md: -------------------------------------------------------------------------------- 1 | # ProtectionBase.sol 2 | 3 | 4 | - [abstract.ProtectionBase](./abstract.ProtectionBase.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/functions/protected/protection/index.md: -------------------------------------------------------------------------------- 1 | # Protection 2 | 3 | 4 | - [FeatureToggle](./FeatureToggle.sol/library.FeatureToggle.md) 5 | - [Initialization](./Initialization.sol/library.Initialization.md) 6 | - [MsgSender](./MsgSender.sol/library.MsgSender.md) 7 | - [ProtectionBase](./ProtectionBase.sol/abstract.ProtectionBase.md) 8 | 9 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/index.md: -------------------------------------------------------------------------------- 1 | # Standard Functions 2 | 3 | 4 | - [functions](./functions/index.md) 5 | - [interfaces](./interfaces/index.md) 6 | - [storage](./storage/index.md) 7 | 8 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/interfaces/IStd.sol/index.md: -------------------------------------------------------------------------------- 1 | # IStd.sol 2 | 3 | 4 | - [interface.IStd](./interface.IStd.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/interfaces/IStd.sol/interface.IStd.md: -------------------------------------------------------------------------------- 1 | # IStd 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/interfaces/IStd.sol) 3 | 4 | **Inherits:** 5 | [IProxy](../../../../../../03-api/03-api-details/Flattened.sol/interface.IProxy.md) 6 | 7 | 8 | ## Functions 9 | ### clone 10 | 11 | 12 | ```solidity 13 | function clone(bytes calldata initData) external returns (address proxy); 14 | ``` 15 | 16 | ### getFunctions 17 | 18 | 19 | ```solidity 20 | function getFunctions() external view returns (GetFunctions.Function[] memory); 21 | ``` 22 | 23 | ### featureToggle 24 | 25 | 26 | ```solidity 27 | function featureToggle(bytes4 selector) external; 28 | ``` 29 | 30 | ### initSetAdmin 31 | 32 | 33 | ```solidity 34 | function initSetAdmin(address admin) external; 35 | ``` 36 | 37 | ### upgradeDictionary 38 | 39 | 40 | ```solidity 41 | function upgradeDictionary(address newDictionary) external; 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/interfaces/StdFacade.sol/contract.StdFacade.md: -------------------------------------------------------------------------------- 1 | # StdFacade 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/interfaces/StdFacade.sol) 3 | 4 | **Inherits:** 5 | [IStd](../IStd.sol/interface.IStd.md) 6 | 7 | 8 | ## Functions 9 | ### clone 10 | 11 | 12 | ```solidity 13 | function clone(bytes calldata initData) external returns (address proxy); 14 | ``` 15 | 16 | ### getFunctions 17 | 18 | 19 | ```solidity 20 | function getFunctions() external view returns (GetFunctions.Function[] memory); 21 | ``` 22 | 23 | ### featureToggle 24 | 25 | 26 | ```solidity 27 | function featureToggle(bytes4 selector) external; 28 | ``` 29 | 30 | ### initSetAdmin 31 | 32 | 33 | ```solidity 34 | function initSetAdmin(address admin) external; 35 | ``` 36 | 37 | ### upgradeDictionary 38 | 39 | 40 | ```solidity 41 | function upgradeDictionary(address newDictionary) external; 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/interfaces/StdFacade.sol/index.md: -------------------------------------------------------------------------------- 1 | # StdFacade.sol 2 | 3 | 4 | - [contract.StdFacade](./contract.StdFacade.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/interfaces/index.md: -------------------------------------------------------------------------------- 1 | # Interfaces 2 | 3 | 4 | - [IStd](./IStd.sol/interface.IStd.md) 5 | - [StdFacade](./StdFacade.sol/contract.StdFacade.md) 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/storage/Schema.sol/index.md: -------------------------------------------------------------------------------- 1 | # Schema.sol 2 | 3 | 4 | - [interface.Schema](./interface.Schema.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/storage/Storage.sol/index.md: -------------------------------------------------------------------------------- 1 | # Storage.sol 2 | 3 | 4 | - [library.Storage](./library.Storage.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/storage/Storage.sol/library.Storage.md: -------------------------------------------------------------------------------- 1 | # Storage 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/std/storage/Storage.sol) 3 | 4 | Storage Library v0.1.0 5 | 6 | 7 | ## Functions 8 | ### Admin 9 | 10 | 11 | ```solidity 12 | function Admin() internal pure returns (Schema.$Admin storage ref); 13 | ``` 14 | 15 | ### Clones 16 | 17 | 18 | ```solidity 19 | function Clones() internal pure returns (Schema.$Clone storage ref); 20 | ``` 21 | 22 | ### Proposal 23 | 24 | 25 | ```solidity 26 | function Proposal() internal pure returns (Schema.$Proposal storage ref); 27 | ``` 28 | 29 | ### Member 30 | 31 | 32 | ```solidity 33 | function Member() internal pure returns (Schema.$Member storage ref); 34 | ``` 35 | 36 | ### FeatureToggle 37 | 38 | 39 | ```solidity 40 | function FeatureToggle() internal pure returns (Schema.$FeatureToggle storage ref); 41 | ``` 42 | 43 | ### Initialization 44 | 45 | 46 | ```solidity 47 | function Initialization() internal pure returns (Schema.$Initialization storage ref); 48 | ``` 49 | 50 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/05-std/storage/index.md: -------------------------------------------------------------------------------- 1 | # Storage 2 | 3 | 4 | - [Schema](./Schema.sol/interface.Schema.md) 5 | - [Storage](./Storage.sol/library.Storage.md) 6 | 7 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/03-std-functions/index.md: -------------------------------------------------------------------------------- 1 | # Standard Functions 2 | 3 | comming soon 4 | 5 | -------------------------------------------------------------------------------- /site/docs/02-guides/02-development/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [best-practices, ai-tdd, internal-library] 3 | tags: [best-practices, ai-tdd, internal-library] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Development Guide 10 | 11 | This section covers recommended practices and methodologies for developing with Meta Contract. These best practices are designed to improve code quality, efficiency, and maintainability. 12 | 13 | ## Contents 14 | 15 | - [Useful Resources](./01-resources.md) 16 | - [Test-Driven Development](./02-tdd.md) 17 | - [Using Standard Functions](./03-std-functions/index.md) 18 | - [Using Internal Libraries](./04-using-internal-library.md) 19 | -------------------------------------------------------------------------------- /site/docs/02-guides/03-operations/02-contract-verification.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [contract-verification, smart-contracts, blockchain, foundry, metacontract] 3 | tags: [contract-verification, smart-contracts, blockchain, foundry, metacontract] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract DevOps Team 7 | --- 8 | 9 | # Contract Verification 10 | 11 | This guide outlines the process of verifying Meta Contract contracts. 12 | 13 | Meta Contract supports Etherscan's contract verification. To utilize Etherscan's "Read as Proxy" or "Write as Proxy" features, it is necessary to use a Facade contract to register the contract's interface. 14 | -------------------------------------------------------------------------------- /site/docs/02-guides/03-operations/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [best-practices, deployment, contract-verification, upgrades, cicd] 3 | tags: [best-practices, deployment, contract-verification, upgrades, cicd] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Operations Guide 10 | 11 | This section covers recommended practices and methodologies for operating with Meta Contract. These best practices are designed to improve code quality, efficiency, and maintainability. 12 | 13 | ## Contents 14 | 15 | - [Deployment](./01-deployment.md) 16 | - [Contract Verification](./02-contract-verification.md) 17 | - [Upgrades](./03-upgrades.md) 18 | - [CI/CD](./04-ci-cd.md) 19 | -------------------------------------------------------------------------------- /site/docs/02-guides/04-middlewares/01-the-graph.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [integration, the-graph, subgraph, indexing] 3 | tags: [integration, the-graph, subgraph, indexing] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # The Graph 10 | 11 | [The Graph](https://thegraph.com/) is a decentralized protocol for indexing and querying data from blockchains, starting with Ethereum. It allows developers to build and publish open APIs, called subgraphs, that applications can query using GraphQL. 12 | 13 | ## Creating a Subgraph with Meta Contracts 14 | 15 | In Meta Contracts, a subgraph is created based on Bundle's events. This allows for efficient querying and indexing of event data within the blockchain ecosystem. 16 | -------------------------------------------------------------------------------- /site/docs/02-guides/04-middlewares/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [middleware, integration, the-graph] 3 | tags: [middleware, integration, the-graph] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Middleware Guide 10 | 11 | This section provides guidance on integrating Meta Contract with various blockchain tools and services. 12 | 13 | ## Contents 14 | 15 | - [The Graph](./01-the-graph.md) 16 | -------------------------------------------------------------------------------- /site/docs/02-guides/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [devops, TDD, implementation, deployment, upgrades, ci-cd, foundry] 3 | tags: [devops, TDD, implementation, deployment, upgrades, ci-cd, foundry] 4 | last_update: 5 | date: 2024-10-28 6 | author: Meta Contract DevOps Team 7 | --- 8 | 9 | # Guides 10 | 11 | This section outlines key DevOps processes and tools for Meta Contract projects, ensuring reliable, secure, and efficient smart contract development and operations. 12 | 13 | ## Contents 14 | 15 | 1. **[Setup](./01-setup/index.md)**: Setup overview. 16 | - Installation 17 | - Configuration 18 | 2. **[Development](./02-development/index.md)**: Development best practices. 19 | - Resources 20 | - TDD 21 | - Functions 22 | - Libraries 23 | 3. **[Operations](./03-operations/index.md)**: Deployment strategies. 24 | - Deployment 25 | - Contract Verification 26 | - Upgrade 27 | - CI/CD 28 | 4. **[Middleware](./04-middlewares/index.md)**: Middleware tools. 29 | - The Graph 30 | 5. **[Project Management](./05-project-management/index.md)**: Management guidelines. 31 | - Community Profile 32 | - Project Documentations 33 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.Context.md: -------------------------------------------------------------------------------- 1 | # Context 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | *Provides information about the current execution context, including the 5 | sender of the transaction and its data. While these are generally available 6 | via msg.sender and msg.data, they should not be accessed in such a direct 7 | manner, since when dealing with meta-transactions the account sending and 8 | paying for execution may not be the actual sender (as far as an application 9 | is concerned). 10 | This contract is only required for intermediate, library-like contracts.* 11 | 12 | 13 | ## Functions 14 | ### _msgSender 15 | 16 | 17 | ```solidity 18 | function _msgSender() internal view virtual returns (address); 19 | ``` 20 | 21 | ### _msgData 22 | 23 | 24 | ```solidity 25 | function _msgData() internal view virtual returns (bytes calldata); 26 | ``` 27 | 28 | ### _contextSuffixLength 29 | 30 | 31 | ```solidity 32 | function _contextSuffixLength() internal view virtual returns (uint256); 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.MCBase.md: -------------------------------------------------------------------------------- 1 | # MCBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [CommonBase](abstract.CommonBase.md) 6 | 7 | 8 | ## State Variables 9 | ### mc 10 | 11 | ```solidity 12 | MCDevKit internal mc; 13 | ``` 14 | 15 | 16 | ### deployerKey 17 | 18 | ```solidity 19 | uint256 internal deployerKey; 20 | ``` 21 | 22 | 23 | ### deployer 24 | 25 | ```solidity 26 | address internal deployer; 27 | ``` 28 | 29 | 30 | ## Functions 31 | ### constructor 32 | 33 | 34 | ```solidity 35 | constructor(); 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.MCScript.md: -------------------------------------------------------------------------------- 1 | # MCScript 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [MCScriptBase](abstract.MCScriptBase.md) 6 | 7 | 8 | ## Functions 9 | ### _saveAddrToEnv 10 | 11 | 12 | ```solidity 13 | function _saveAddrToEnv(address addr, string memory envKeyBase) internal; 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.MCScriptBase.md: -------------------------------------------------------------------------------- 1 | # MCScriptBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [MCBase](abstract.MCBase.md), [Script](abstract.Script.md) 6 | 7 | 8 | ## Functions 9 | ### startBroadcastWith 10 | 11 | 12 | ```solidity 13 | modifier startBroadcastWith(string memory envKey); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.MCTestBase.md: -------------------------------------------------------------------------------- 1 | # MCTestBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [MCBase](abstract.MCBase.md), [Test](abstract.Test.md) 6 | 7 | 8 | ## Functions 9 | ### startPrankWith 10 | 11 | 12 | ```solidity 13 | modifier startPrankWith(string memory envKey); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.ProtectionBase.md: -------------------------------------------------------------------------------- 1 | # ProtectionBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### initializer 7 | 8 | 9 | ```solidity 10 | modifier initializer(); 11 | ``` 12 | 13 | ### onlyAdmin 14 | 15 | 16 | ```solidity 17 | modifier onlyAdmin(); 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.Script.md: -------------------------------------------------------------------------------- 1 | # Script 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [ScriptBase](abstract.ScriptBase.md), [StdChains](abstract.StdChains.md), [StdCheatsSafe](abstract.StdCheatsSafe.md), [StdUtils](abstract.StdUtils.md) 6 | 7 | 8 | ## State Variables 9 | ### IS_SCRIPT 10 | 11 | ```solidity 12 | bool public IS_SCRIPT = true; 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.ScriptBase.md: -------------------------------------------------------------------------------- 1 | # ScriptBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [CommonBase](abstract.CommonBase.md) 6 | 7 | 8 | ## State Variables 9 | ### vmSafe 10 | 11 | ```solidity 12 | VmSafe internal constant vmSafe = VmSafe(VM_ADDRESS); 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.Test.md: -------------------------------------------------------------------------------- 1 | # Test 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [TestBase](abstract.TestBase.md), [StdAssertions](abstract.StdAssertions.md), [StdChains](abstract.StdChains.md), [StdCheats](abstract.StdCheats.md), [StdInvariant](abstract.StdInvariant.md), [StdUtils](abstract.StdUtils.md) 6 | 7 | 8 | ## State Variables 9 | ### IS_TEST 10 | 11 | ```solidity 12 | bool public IS_TEST = true; 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/abstract.TestBase.md: -------------------------------------------------------------------------------- 1 | # TestBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [CommonBase](abstract.CommonBase.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/constants.Flattened.md: -------------------------------------------------------------------------------- 1 | # Constants 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | ### vm 5 | *address(uint160(uint256(keccak256("hevm cheat code"))));* 6 | 7 | 8 | ```solidity 9 | Vm constant vm = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.BeaconDictionary.md: -------------------------------------------------------------------------------- 1 | # BeaconDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [UpgradeableBeacon](contract.UpgradeableBeacon.md) 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(address implementation_, address initialOwner) UpgradeableBeacon(implementation_, initialOwner); 14 | ``` 15 | 16 | ### getImplementation 17 | 18 | 19 | ```solidity 20 | function getImplementation(bytes4 selector) external view returns (address); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.Clone.md: -------------------------------------------------------------------------------- 1 | # Clone 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### clone 14 | 15 | DO NOT USE STORAGE DIRECTLY !!! 16 | 17 | 18 | ```solidity 19 | function clone(bytes calldata initData) external returns (address proxy); 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.Dictionary_0.md: -------------------------------------------------------------------------------- 1 | # Dictionary_0 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [DictionaryBase](abstract.DictionaryBase.md), [Ownable](abstract.Ownable.md), [IDictionary](interface.IDictionary.md) 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(address owner) Ownable(owner); 14 | ``` 15 | 16 | ### setImplementation 17 | 18 | 19 | ```solidity 20 | function setImplementation(bytes4 selector, address implementation) external onlyOwner; 21 | ``` 22 | 23 | ### upgradeFacade 24 | 25 | 26 | ```solidity 27 | function upgradeFacade(address newFacade) external onlyOwner; 28 | ``` 29 | 30 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.DummyContract.md: -------------------------------------------------------------------------------- 1 | # DummyContract 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.DummyFacade.md: -------------------------------------------------------------------------------- 1 | # DummyFacade 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.DummyFunction.md: -------------------------------------------------------------------------------- 1 | # DummyFunction 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### dummy 7 | 8 | 9 | ```solidity 10 | function dummy() external; 11 | ``` 12 | 13 | ### dummy2 14 | 15 | 16 | ```solidity 17 | function dummy2() external; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.FeatureToggle.md: -------------------------------------------------------------------------------- 1 | # FeatureToggle 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../../../02-guides/02-development/03-std-functions/05-std/functions/protected/protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - 0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### featureToggle 17 | 18 | DO NOT USE STORAGE DIRECTLY !!! 19 | 20 | 21 | ```solidity 22 | function featureToggle(bytes4 selector) external onlyAdmin; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.GetFunctions.md: -------------------------------------------------------------------------------- 1 | # GetFunctions 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### getFunctions 14 | 15 | 16 | ```solidity 17 | function getFunctions() external view returns (Function[] memory); 18 | ``` 19 | 20 | ## Structs 21 | ### Function 22 | DO NOT USE STORAGE DIRECTLY !!! 23 | 24 | 25 | ```solidity 26 | struct Function { 27 | bytes4 selector; 28 | address implementation; 29 | } 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.ImmutableDictionary.md: -------------------------------------------------------------------------------- 1 | # ImmutableDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [DictionaryBase](abstract.DictionaryBase.md) 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(Function[] memory _functions, address _facade); 14 | ``` 15 | 16 | ### __existsSameSelector 17 | 18 | 19 | ```solidity 20 | function __existsSameSelector(bytes4 _selector) internal override returns (bool); 21 | ``` 22 | 23 | ## Errors 24 | ### SelectorAlreadyExists 25 | 26 | ```solidity 27 | error SelectorAlreadyExists(bytes4 selector); 28 | ``` 29 | 30 | ## Structs 31 | ### Function 32 | 33 | ```solidity 34 | struct Function { 35 | bytes4 selector; 36 | address implementation; 37 | } 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.InitSetAdmin.md: -------------------------------------------------------------------------------- 1 | # InitSetAdmin 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../../../02-guides/02-development/03-std-functions/05-std/functions/protected/protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - v0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### initSetAdmin 17 | 18 | 19 | ```solidity 20 | function initSetAdmin(address admin) external initializer; 21 | ``` 22 | 23 | ## Events 24 | ### AdminSet 25 | DO NOT USE STORAGE DIRECTLY !!! 26 | 27 | 28 | ```solidity 29 | event AdminSet(address admin); 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.MockDictionary.md: -------------------------------------------------------------------------------- 1 | # MockDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [Dictionary_0](contract.Dictionary_0.md) 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(address owner, Function[] memory functions) Dictionary_0(owner); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.Proxy_1.md: -------------------------------------------------------------------------------- 1 | # Proxy_1 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [Proxy_0](abstract.Proxy_0.md) 6 | 7 | *Library version has been tested with version 5.0.0.* 8 | 9 | 10 | ## Functions 11 | ### constructor 12 | 13 | 14 | ```solidity 15 | constructor(address dictionary, bytes memory _data) payable; 16 | ``` 17 | 18 | ### _implementation 19 | 20 | *Return the implementation address corresponding to the function selector.* 21 | 22 | 23 | ```solidity 24 | function _implementation() internal view override returns (address); 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.Receive.md: -------------------------------------------------------------------------------- 1 | # Receive 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | < MC Standard Function > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### receive 14 | 15 | 16 | ```solidity 17 | receive() external payable; 18 | ``` 19 | 20 | ## Events 21 | ### Received 22 | DO NOT USE STORAGE DIRECTLY !!! 23 | 24 | 25 | ```solidity 26 | event Received(address from, uint256 amount); 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.SimpleMockProxy.md: -------------------------------------------------------------------------------- 1 | # SimpleMockProxy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [Proxy_0](abstract.Proxy_0.md) 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(Function[] memory functions); 14 | ``` 15 | 16 | ### _implementation 17 | 18 | 19 | ```solidity 20 | function _implementation() internal view override returns (address); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.StdFacade.md: -------------------------------------------------------------------------------- 1 | # StdFacade 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [IStd](../../../02-guides/02-development/03-std-functions/05-std/interfaces/IStd.sol/interface.IStd.md) 6 | 7 | 8 | ## Functions 9 | ### clone 10 | 11 | 12 | ```solidity 13 | function clone(bytes calldata initData) external returns (address proxy); 14 | ``` 15 | 16 | ### getFunctions 17 | 18 | 19 | ```solidity 20 | function getFunctions() external view returns (GetFunctions.Function[] memory); 21 | ``` 22 | 23 | ### featureToggle 24 | 25 | 26 | ```solidity 27 | function featureToggle(bytes4 selector) external; 28 | ``` 29 | 30 | ### initSetAdmin 31 | 32 | 33 | ```solidity 34 | function initSetAdmin(address admin) external; 35 | ``` 36 | 37 | ### upgradeDictionary 38 | 39 | 40 | ```solidity 41 | function upgradeDictionary(address newDictionary) external; 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/contract.UpgradeDictionary.md: -------------------------------------------------------------------------------- 1 | # UpgradeDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [ProtectionBase](../../../02-guides/02-development/03-std-functions/05-std/functions/protected/protection/ProtectionBase.sol/abstract.ProtectionBase.md) 6 | 7 | < MC Standard Function > 8 | 9 | **Notes:** 10 | - 0.1.0 11 | 12 | - v0.1.0 13 | 14 | 15 | ## Functions 16 | ### upgradeDictionary 17 | 18 | DO NOT USE STORAGE DIRECTLY !!! 19 | 20 | 21 | ```solidity 22 | function upgradeDictionary(address newDictionary) external onlyAdmin; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/enum.DictionaryKind.md: -------------------------------------------------------------------------------- 1 | # DictionaryKind 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | -------------------- 5 | Dictionary Kind 6 | ---------------------- 7 | 8 | 9 | ```solidity 10 | enum DictionaryKind { 11 | undefined, 12 | Verifiable, 13 | Immutable, 14 | Beacon, 15 | Mock 16 | } 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/enum.ProxyKind.md: -------------------------------------------------------------------------------- 1 | # ProxyKind 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------- 5 | Proxy Kind 6 | ----------------- 7 | 8 | 9 | ```solidity 10 | enum ProxyKind { 11 | undefined, 12 | Normal, 13 | Verifiable, 14 | Mock 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/enum.TypeStatus.md: -------------------------------------------------------------------------------- 1 | # TypeStatus 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | enum TypeStatus { 7 | Uninitialized, 8 | Building, 9 | Built, 10 | Locked 11 | } 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.loadAddressFrom.md: -------------------------------------------------------------------------------- 1 | # loadAddressFrom 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function loadAddressFrom(string memory envKey) view returns (address); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_0.md: -------------------------------------------------------------------------------- 1 | # param_0 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_0(address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_1.md: -------------------------------------------------------------------------------- 1 | # param_1 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_1(address addr, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_10.md: -------------------------------------------------------------------------------- 1 | # param_10 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_10(string memory str, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_11.md: -------------------------------------------------------------------------------- 1 | # param_11 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_11(Dictionary_1 memory dict) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_12.md: -------------------------------------------------------------------------------- 1 | # param_12 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_12(bytes4 b4) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_13.md: -------------------------------------------------------------------------------- 1 | # param_13 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_13(string memory str, Dictionary_1 memory dictionary, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_14.md: -------------------------------------------------------------------------------- 1 | # param_14 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_14(string memory str, Dictionary_1 memory dictionary) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_15.md: -------------------------------------------------------------------------------- 1 | # param_15 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_15(address addr, string memory str) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_16.md: -------------------------------------------------------------------------------- 1 | # param_16 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_16(Dictionary_1 memory dict, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_17.md: -------------------------------------------------------------------------------- 1 | # param_17 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_17(Dictionary_1 memory dict, bytes4 b4, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_18.md: -------------------------------------------------------------------------------- 1 | # param_18 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_18(Function[] memory functions) pure returns (string memory res); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_19.md: -------------------------------------------------------------------------------- 1 | # param_19 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_19(Bundle memory bundle, address addr, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_2.md: -------------------------------------------------------------------------------- 1 | # param_2 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_2(Dictionary_1 memory dict, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_20.md: -------------------------------------------------------------------------------- 1 | # param_20 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_20(string memory str, bytes4 b4, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_21.md: -------------------------------------------------------------------------------- 1 | # param_21 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_21(string memory str, Proxy_2 memory proxy) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_22.md: -------------------------------------------------------------------------------- 1 | # param_22 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_22(string memory str, Function[] memory funcs) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_23.md: -------------------------------------------------------------------------------- 1 | # param_23 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_23(string memory str, address addr, Function[] memory funcs) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_24.md: -------------------------------------------------------------------------------- 1 | # param_24 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_24(bytes4 b4, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_25.md: -------------------------------------------------------------------------------- 1 | # param_25 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_25(Bundle memory bundle) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_26.md: -------------------------------------------------------------------------------- 1 | # param_26 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_26(Bundle memory bundle, bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_27.md: -------------------------------------------------------------------------------- 1 | # param_27 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | Params 5 | 6 | 7 | ```solidity 8 | function param_27(string memory str) pure returns (string memory); 9 | ``` 10 | 11 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_3.md: -------------------------------------------------------------------------------- 1 | # param_3 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_3(Dictionary_1 memory dict1, Dictionary_1 memory dict2) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_4.md: -------------------------------------------------------------------------------- 1 | # param_4 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_4(bytes memory b) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_5.md: -------------------------------------------------------------------------------- 1 | # param_5 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_5(address addr, address addr2) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_6.md: -------------------------------------------------------------------------------- 1 | # param_6 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_6(Function memory func) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_7.md: -------------------------------------------------------------------------------- 1 | # param_7 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_7(Bundle memory bundle, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_8.md: -------------------------------------------------------------------------------- 1 | # param_8 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_8(Function[] memory functions, address facade) pure returns (string memory res); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/function.param_9.md: -------------------------------------------------------------------------------- 1 | # param_9 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | function param_9(string memory str, address addr) pure returns (string memory); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IBeacon.md: -------------------------------------------------------------------------------- 1 | # IBeacon 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | *This is the interface that {BeaconProxy} expects of its beacon.* 5 | 6 | 7 | ## Functions 8 | ### implementation 9 | 10 | *Must return an address that can be used as a delegate call target. 11 | {UpgradeableBeacon} will check that this address is a contract.* 12 | 13 | 14 | ```solidity 15 | function implementation() external view returns (address); 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IDictionary.md: -------------------------------------------------------------------------------- 1 | # IDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [IDictionaryCore](interface.IDictionaryCore.md), [IVerifiable](interface.IVerifiable.md) 6 | 7 | 8 | ## Functions 9 | ### setImplementation 10 | 11 | *from IDictionaryCore* 12 | 13 | *from IVerifiable* 14 | 15 | *from IDictionaryCore* 16 | 17 | *from IDictionaryCore* 18 | 19 | *from IVerifiable* 20 | 21 | 22 | ```solidity 23 | function setImplementation(bytes4 functionSelector, address implementation) external; 24 | ``` 25 | 26 | ### upgradeFacade 27 | 28 | 29 | ```solidity 30 | function upgradeFacade(address newFacade) external; 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IDictionaryCore.md: -------------------------------------------------------------------------------- 1 | # IDictionaryCore 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### getImplementation 7 | 8 | 9 | ```solidity 10 | function getImplementation(bytes4 selector) external view returns (address); 11 | ``` 12 | 13 | ## Events 14 | ### NewFunctionSelectorAdded 15 | 16 | ```solidity 17 | event NewFunctionSelectorAdded(bytes4 newSelector); 18 | ``` 19 | 20 | ### ImplementationDeleted 21 | 22 | ```solidity 23 | event ImplementationDeleted(bytes4 selector); 24 | ``` 25 | 26 | ### ImplementationUpgraded 27 | 28 | ```solidity 29 | event ImplementationUpgraded(bytes4 selector, address implementation); 30 | ``` 31 | 32 | ## Errors 33 | ### ImplementationNotFound 34 | 35 | ```solidity 36 | error ImplementationNotFound(bytes4 selector); 37 | ``` 38 | 39 | ### InvalidImplementation 40 | 41 | ```solidity 42 | error InvalidImplementation(address implementation); 43 | ``` 44 | 45 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IERC165_0.md: -------------------------------------------------------------------------------- 1 | # IERC165_0 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### supportsInterface 7 | 8 | Query if a contract implements an interface 9 | 10 | *Interface identification is specified in ERC-165. This function 11 | uses less than 30,000 gas.* 12 | 13 | 14 | ```solidity 15 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 16 | ``` 17 | **Parameters** 18 | 19 | |Name|Type|Description| 20 | |----|----|-----------| 21 | |`interfaceID`|`bytes4`|The interface identifier, as specified in ERC-165| 22 | 23 | **Returns** 24 | 25 | |Name|Type|Description| 26 | |----|----|-----------| 27 | |``|`bool`|`true` if the contract implements `interfaceID` and `interfaceID` is not 0xffffffff, `false` otherwise| 28 | 29 | 30 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IERC165_1.md: -------------------------------------------------------------------------------- 1 | # IERC165_1 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | *Interface of the ERC165 standard, as defined in the 5 | https://eips.ethereum.org/EIPS/eip-165[EIP]. 6 | Implementers can declare support of contract interfaces, which can then be 7 | queried by others ({ERC165Checker}). 8 | For an implementation, see {ERC165}.* 9 | 10 | 11 | ## Functions 12 | ### supportsInterface 13 | 14 | *Returns true if this contract implements the interface defined by 15 | `interfaceId`. See the corresponding 16 | https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] 17 | to learn more about how these ids are created. 18 | This function call must use less than 30 000 gas.* 19 | 20 | 21 | ```solidity 22 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IERC721Metadata.md: -------------------------------------------------------------------------------- 1 | # IERC721Metadata 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [IERC721](interface.IERC721.md) 6 | 7 | *See https://eips.ethereum.org/EIPS/eip-721 8 | Note: the ERC-165 identifier for this interface is 0x5b5e139f.* 9 | 10 | 11 | ## Functions 12 | ### name 13 | 14 | A descriptive name for a collection of NFTs in this contract 15 | 16 | 17 | ```solidity 18 | function name() external view returns (string memory _name); 19 | ``` 20 | 21 | ### symbol 22 | 23 | An abbreviated name for NFTs in this contract 24 | 25 | 26 | ```solidity 27 | function symbol() external view returns (string memory _symbol); 28 | ``` 29 | 30 | ### tokenURI 31 | 32 | A distinct Uniform Resource Identifier (URI) for a given asset. 33 | 34 | *Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC 35 | 3986. The URI may point to a JSON file that conforms to the "ERC721 36 | Metadata JSON Schema".* 37 | 38 | 39 | ```solidity 40 | function tokenURI(uint256 _tokenId) external view returns (string memory); 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IERC721TokenReceiver.md: -------------------------------------------------------------------------------- 1 | # IERC721TokenReceiver 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | *Note: the ERC-165 identifier for this interface is 0x150b7a02.* 5 | 6 | 7 | ## Functions 8 | ### onERC721Received 9 | 10 | Handle the receipt of an NFT 11 | 12 | *The ERC721 smart contract calls this function on the recipient 13 | after a `transfer`. This function MAY throw to revert and reject the 14 | transfer. Return of other than the magic value MUST result in the 15 | transaction being reverted. 16 | Note: the contract address is always the message sender.* 17 | 18 | 19 | ```solidity 20 | function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) 21 | external 22 | returns (bytes4); 23 | ``` 24 | **Parameters** 25 | 26 | |Name|Type|Description| 27 | |----|----|-----------| 28 | |`_operator`|`address`|The address which called `safeTransferFrom` function| 29 | |`_from`|`address`|The address which previously owned the token| 30 | |`_tokenId`|`uint256`|The NFT identifier which is being transferred| 31 | |`_data`|`bytes`|Additional data with no specified format| 32 | 33 | **Returns** 34 | 35 | |Name|Type|Description| 36 | |----|----|-----------| 37 | |``|`bytes4`|`bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` unless throwing| 38 | 39 | 40 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IProxy.md: -------------------------------------------------------------------------------- 1 | # IProxy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Events 6 | ### DictionaryUpgraded 7 | *Emitted when the dictionary is changed.* 8 | 9 | 10 | ```solidity 11 | event DictionaryUpgraded(address dictionary); 12 | ``` 13 | 14 | ## Errors 15 | ### NON_CONTRACT 16 | *The `dictionary` of the proxy is invalid.* 17 | 18 | 19 | ```solidity 20 | error NON_CONTRACT(); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IStd.md: -------------------------------------------------------------------------------- 1 | # IStd 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [IProxy](interface.IProxy.md) 6 | 7 | 8 | ## Functions 9 | ### clone 10 | 11 | 12 | ```solidity 13 | function clone(bytes calldata initData) external returns (address proxy); 14 | ``` 15 | 16 | ### getFunctions 17 | 18 | 19 | ```solidity 20 | function getFunctions() external view returns (GetFunctions.Function[] memory); 21 | ``` 22 | 23 | ### featureToggle 24 | 25 | 26 | ```solidity 27 | function featureToggle(bytes4 selector) external; 28 | ``` 29 | 30 | ### initSetAdmin 31 | 32 | 33 | ```solidity 34 | function initSetAdmin(address admin) external; 35 | ``` 36 | 37 | ### upgradeDictionary 38 | 39 | 40 | ```solidity 41 | function upgradeDictionary(address newDictionary) external; 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/interface.IVerifiable.md: -------------------------------------------------------------------------------- 1 | # IVerifiable 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | **Inherits:** 5 | [IBeacon](interface.IBeacon.md), [IERC165_1](interface.IERC165_1.md) 6 | 7 | *Library version has been tested with version 5.0.0.* 8 | 9 | 10 | ## Functions 11 | ### supportsInterfaces 12 | 13 | *from IBeacon* 14 | 15 | *from IERC165* 16 | 17 | 18 | ```solidity 19 | function supportsInterfaces() external view returns (bytes4[] memory); 20 | ``` 21 | 22 | ## Events 23 | ### FacadeUpgraded 24 | 25 | ```solidity 26 | event FacadeUpgraded(address newFacade); 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.BundleLib.md: -------------------------------------------------------------------------------- 1 | # BundleLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### assignName 7 | 8 | -------------------- 9 | 📛 Assign Name 10 | ---------------------- 11 | 12 | 13 | ```solidity 14 | function assignName(Bundle storage bundle, string memory name) internal returns (Bundle storage); 15 | ``` 16 | 17 | ### pushFunction 18 | 19 | ------------------------- 20 | 🧩 Push Function(s) 21 | --------------------------- 22 | 23 | 24 | ```solidity 25 | function pushFunction(Bundle storage bundle, Function storage func) internal returns (Bundle storage); 26 | ``` 27 | 28 | ### pushFunctions 29 | 30 | 31 | ```solidity 32 | function pushFunctions(Bundle storage bundle, Function[] storage functions) internal returns (Bundle storage); 33 | ``` 34 | 35 | ### assignFacade 36 | 37 | ---------------------- 38 | 🪟 Assign Facade 39 | ------------------------ 40 | 41 | 42 | ```solidity 43 | function assignFacade(Bundle storage bundle, address facade) internal returns (Bundle storage); 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.BundleRegistryLib.md: -------------------------------------------------------------------------------- 1 | # BundleRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### init 7 | 8 | --------------------- 9 | 🌱 Init Bundle 10 | ----------------------- 11 | 12 | 13 | ```solidity 14 | function init(BundleRegistry storage registry, string memory name) internal returns (BundleRegistry storage); 15 | ``` 16 | 17 | ### ensureInit 18 | 19 | 20 | ```solidity 21 | function ensureInit(BundleRegistry storage registry) internal returns (BundleRegistry storage); 22 | ``` 23 | 24 | ### find 25 | 26 | -------------------- 27 | 🔍 Find Bundle 28 | ---------------------- 29 | 30 | 31 | ```solidity 32 | function find(BundleRegistry storage registry, string memory name) internal returns (Bundle storage bundle); 33 | ``` 34 | 35 | ### findCurrent 36 | 37 | 38 | ```solidity 39 | function findCurrent(BundleRegistry storage registry) internal returns (Bundle storage bundle); 40 | ``` 41 | 42 | ### genUniqueName 43 | 44 | ----------------------------- 45 | 🏷 Generate Unique Name 46 | ------------------------------- 47 | 48 | 49 | ```solidity 50 | function genUniqueName(BundleRegistry storage registry) internal returns (string memory name); 51 | ``` 52 | 53 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.ConfigLib.md: -------------------------------------------------------------------------------- 1 | # ConfigLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### load 7 | 8 | 9 | ```solidity 10 | function load(ConfigState storage config) internal; 11 | ``` 12 | 13 | ### loadFromLibMC 14 | 15 | 16 | ```solidity 17 | function loadFromLibMC(ConfigState storage config) internal; 18 | ``` 19 | 20 | ### loadFromProjectRoot 21 | 22 | 23 | ```solidity 24 | function loadFromProjectRoot(ConfigState storage config) internal; 25 | ``` 26 | 27 | ### loadFrom 28 | 29 | 30 | ```solidity 31 | function loadFrom(ConfigState storage config, string memory path) internal; 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.CurrentLib.md: -------------------------------------------------------------------------------- 1 | # CurrentLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### update 7 | 8 | ------------------------------- 9 | 🔄 Update Current Context 10 | --------------------------------- 11 | 12 | 13 | ```solidity 14 | function update(Current storage current, string memory name) internal; 15 | ``` 16 | 17 | ### reset 18 | 19 | ------------------------------ 20 | 🧹 Reset Current Context 21 | -------------------------------- 22 | 23 | 24 | ```solidity 25 | function reset(Current storage current) internal; 26 | ``` 27 | 28 | ### find 29 | 30 | ------------------ 31 | 🔍 Find Name 32 | -------------------- 33 | 34 | 35 | ```solidity 36 | function find(Current storage current) internal returns (string memory name); 37 | ``` 38 | 39 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.Dummy.md: -------------------------------------------------------------------------------- 1 | # Dummy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### bundleName 7 | 8 | 9 | ```solidity 10 | function bundleName() internal pure returns (string memory); 11 | ``` 12 | 13 | ### functionSelector 14 | 15 | 16 | ```solidity 17 | function functionSelector() internal pure returns (bytes4); 18 | ``` 19 | 20 | ### functionAddress 21 | 22 | 23 | ```solidity 24 | function functionAddress() internal returns (address); 25 | ``` 26 | 27 | ### facadeAddress 28 | 29 | 30 | ```solidity 31 | function facadeAddress() internal returns (address); 32 | ``` 33 | 34 | ### setBundle 35 | 36 | 37 | ```solidity 38 | function setBundle(MCDevKit storage mc) internal; 39 | ``` 40 | 41 | ### dictionary 42 | 43 | 44 | ```solidity 45 | function dictionary(MCDevKit storage mc) internal returns (address); 46 | ``` 47 | 48 | ### dictionary 49 | 50 | 51 | ```solidity 52 | function dictionary(MCDevKit storage mc, MCTest.Function[] memory functions) internal returns (address); 53 | ``` 54 | 55 | ### contractAddr 56 | 57 | 58 | ```solidity 59 | function contractAddr() internal returns (address); 60 | ``` 61 | 62 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.FunctionRegistryLib.md: -------------------------------------------------------------------------------- 1 | # FunctionRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### register 7 | 8 | -------------------------- 9 | 🗳️ Register Function 10 | ---------------------------- 11 | 12 | 13 | ```solidity 14 | function register(FunctionRegistry storage registry, string memory name, bytes4 selector, address implementation) 15 | internal 16 | returns (FunctionRegistry storage); 17 | ``` 18 | 19 | ### find 20 | 21 | ---------------------- 22 | 🔍 Find Function 23 | ------------------------ 24 | 25 | 26 | ```solidity 27 | function find(FunctionRegistry storage registry, string memory name) internal returns (Function storage func); 28 | ``` 29 | 30 | ### findCurrent 31 | 32 | 33 | ```solidity 34 | function findCurrent(FunctionRegistry storage registry) internal returns (Function storage func); 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.Initialization.md: -------------------------------------------------------------------------------- 1 | # Initialization 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### shouldNotBeCompleted 7 | 8 | 9 | ```solidity 10 | function shouldNotBeCompleted() internal view; 11 | ``` 12 | 13 | ### willBeCompleted 14 | 15 | 16 | ```solidity 17 | function willBeCompleted() internal; 18 | ``` 19 | 20 | ## Events 21 | ### Initialized 22 | 23 | ```solidity 24 | event Initialized(uint64 version); 25 | ``` 26 | 27 | ## Errors 28 | ### InvalidInitialization 29 | 30 | ```solidity 31 | error InvalidInitialization(); 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.MCFinderLib.md: -------------------------------------------------------------------------------- 1 | # MCFinderLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 🔍 Finder 5 | 🏠 Find Current Proxy Address 6 | 📚 Find Current Dictionary Address 7 | 8 | 9 | ## Functions 10 | ### toProxyAddress 11 | 12 | ---------------------------------- 13 | 🏠 Find Current Proxy Address 14 | ------------------------------------ 15 | 16 | 17 | ```solidity 18 | function toProxyAddress(MCDevKit storage mc) internal returns (address); 19 | ``` 20 | 21 | ### toDictionaryAddress 22 | 23 | ---------------------------------------- 24 | 📚 Find Current Dictionary Address 25 | ------------------------------------------ 26 | 27 | 28 | ```solidity 29 | function toDictionaryAddress(MCDevKit storage mc) internal returns (address); 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.MsgSender.md: -------------------------------------------------------------------------------- 1 | # MsgSender 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### shouldBeAdmin 7 | 8 | 9 | ```solidity 10 | function shouldBeAdmin() internal view; 11 | ``` 12 | 13 | ### shouldBeMember 14 | 15 | 16 | ```solidity 17 | function shouldBeMember() internal view; 18 | ``` 19 | 20 | ## Errors 21 | ### NotAdmin 22 | 23 | ```solidity 24 | error NotAdmin(); 25 | ``` 26 | 27 | ### NotMember 28 | 29 | ```solidity 30 | error NotMember(); 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.Parser.md: -------------------------------------------------------------------------------- 1 | # Parser 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | =============== 5 | 🗒️ Parser 6 | ================= 7 | 8 | 9 | ## Functions 10 | ### toLogLevel 11 | 12 | =============== 13 | 📊 Logger 14 | ================= 15 | 16 | 17 | ```solidity 18 | function toLogLevel(string memory str) internal pure returns (Logger.Level); 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.ProxyCreator.md: -------------------------------------------------------------------------------- 1 | # ProxyCreator 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | < MC Standard Helper Library > 5 | 6 | **Notes:** 7 | - v0.1.0 8 | 9 | - none 10 | 11 | 12 | ## Functions 13 | ### create 14 | 15 | 16 | ```solidity 17 | function create(address dictionary, bytes memory initData) internal returns (address proxy); 18 | ``` 19 | 20 | ## Events 21 | ### ProxyCreated 22 | 23 | ```solidity 24 | event ProxyCreated(address dictionary, address proxy); 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.ProxyLib.md: -------------------------------------------------------------------------------- 1 | # ProxyLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### deploy 7 | 8 | --------------------- 9 | 🚀 Deploy Proxy 10 | ----------------------- 11 | 12 | 13 | ```solidity 14 | function deploy(Dictionary_1 memory dictionary, bytes memory initData) internal returns (Proxy_2 memory proxy); 15 | ``` 16 | 17 | ### createSimpleMock 18 | 19 | -------------------------- 20 | 🤖 Create Proxy Mock 21 | ---------------------------- 22 | 23 | 24 | ```solidity 25 | function createSimpleMock(Function[] memory functions) internal returns (Proxy_2 memory mockProxy); 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.ProxyRegistryLib.md: -------------------------------------------------------------------------------- 1 | # ProxyRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### register 7 | 8 | ----------------------- 9 | 🗳️ Register Proxy 10 | ------------------------- 11 | 12 | 13 | ```solidity 14 | function register(ProxyRegistry storage registry, string memory name, Proxy_2 memory _proxy) 15 | internal 16 | returns (Proxy_2 storage proxy); 17 | ``` 18 | 19 | ### find 20 | 21 | ------------------- 22 | 🔍 Find Proxy 23 | --------------------- 24 | 25 | 26 | ```solidity 27 | function find(ProxyRegistry storage registry, string memory name) internal returns (Proxy_2 storage proxy); 28 | ``` 29 | 30 | ### findCurrent 31 | 32 | 33 | ```solidity 34 | function findCurrent(ProxyRegistry storage registry) internal returns (Proxy_2 storage proxy); 35 | ``` 36 | 37 | ### genUniqueName 38 | 39 | ----------------------------- 40 | 🏷 Generate Unique Name 41 | ------------------------------- 42 | 43 | 44 | ```solidity 45 | function genUniqueName(ProxyRegistry storage registry) internal returns (string memory name); 46 | ``` 47 | 48 | ### genUniqueMockName 49 | 50 | 51 | ```solidity 52 | function genUniqueMockName(ProxyRegistry storage registry, string memory baseName) 53 | internal 54 | returns (string memory name); 55 | ``` 56 | 57 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.SimpleMockProxyLib.md: -------------------------------------------------------------------------------- 1 | # SimpleMockProxyLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## State Variables 6 | ### STORAGE_LOCATION 7 | 8 | ```solidity 9 | bytes32 internal constant STORAGE_LOCATION = 0x64a9f0903a8f864d59bc40808555c0090d6ada027fd81884feeb2af9acdbc200; 10 | ``` 11 | 12 | 13 | ## Functions 14 | ### Storage 15 | 16 | 17 | ```solidity 18 | function Storage() internal pure returns (SimpleMockProxyStorage storage ref); 19 | ``` 20 | 21 | ### set 22 | 23 | 24 | ```solidity 25 | function set(bytes4 selector, address implementation) internal; 26 | ``` 27 | 28 | ### getImplementation 29 | 30 | 31 | ```solidity 32 | function getImplementation(bytes4 selector) internal view returns (address); 33 | ``` 34 | 35 | ## Structs 36 | ### SimpleMockProxyStorage 37 | **Note:** 38 | erc7021:mc.mock.proxy 39 | 40 | 41 | ```solidity 42 | struct SimpleMockProxyStorage { 43 | mapping(bytes4 selector => address) implementations; 44 | } 45 | ``` 46 | 47 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.StdFunctionsArgs.md: -------------------------------------------------------------------------------- 1 | # StdFunctionsArgs 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 🧩 Std Ops Primitive Utils for Arguments 5 | 6 | 7 | ## Functions 8 | ### initSetAdminBytes 9 | 10 | 11 | ```solidity 12 | function initSetAdminBytes(address admin) internal pure returns (bytes memory); 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.StdRegistryLib.md: -------------------------------------------------------------------------------- 1 | # StdRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## Functions 6 | ### complete 7 | 8 | ---------------------------------- 9 | 🟢 Complete Standard Registry 10 | ------------------------------------ 11 | 12 | 13 | ```solidity 14 | function complete(StdRegistry storage registry) internal returns (StdRegistry storage); 15 | ``` 16 | 17 | ### configureStdBundle 18 | 19 | ---------------------------------- 20 | 🔧 Configure Standard Bundles 21 | ------------------------------------ 22 | 23 | 24 | ```solidity 25 | function configureStdBundle(StdRegistry storage registry) internal returns (StdRegistry storage); 26 | ``` 27 | 28 | ### configureStdBundle_All 29 | 30 | ===== Each Std Bundle ===== 31 | 32 | 33 | ```solidity 34 | function configureStdBundle_All(StdRegistry storage registry) internal returns (StdRegistry storage); 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.Storage.md: -------------------------------------------------------------------------------- 1 | # Storage 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | Storage Library v0.1.0 5 | 6 | 7 | ## Functions 8 | ### Admin 9 | 10 | 11 | ```solidity 12 | function Admin() internal pure returns (Schema.$Admin storage ref); 13 | ``` 14 | 15 | ### Clones 16 | 17 | 18 | ```solidity 19 | function Clones() internal pure returns (Schema.$Clone storage ref); 20 | ``` 21 | 22 | ### Proposal 23 | 24 | 25 | ```solidity 26 | function Proposal() internal pure returns (Schema.$Proposal storage ref); 27 | ``` 28 | 29 | ### Member 30 | 31 | 32 | ```solidity 33 | function Member() internal pure returns (Schema.$Member storage ref); 34 | ``` 35 | 36 | ### FeatureToggle 37 | 38 | 39 | ```solidity 40 | function FeatureToggle() internal pure returns (Schema.$FeatureToggle storage ref); 41 | ``` 42 | 43 | ### Initialization 44 | 45 | 46 | ```solidity 47 | function Initialization() internal pure returns (Schema.$Initialization storage ref); 48 | ``` 49 | 50 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.System.md: -------------------------------------------------------------------------------- 1 | # System 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | ===============\ 5 | | 💻 System | 6 | \================ 7 | 8 | 9 | ## Functions 10 | ### Config 11 | 12 | 13 | ```solidity 14 | function Config() internal pure returns (ConfigState storage ref); 15 | ``` 16 | 17 | ### Tracer 18 | 19 | 20 | ```solidity 21 | function Tracer() internal pure returns (Trace storage ref); 22 | ``` 23 | 24 | ### Exit 25 | 26 | 27 | ```solidity 28 | function Exit(string memory errorHead, string memory errorDetail) internal view; 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/library.stdMath.md: -------------------------------------------------------------------------------- 1 | # stdMath 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ## State Variables 6 | ### INT256_MIN 7 | 8 | ```solidity 9 | int256 private constant INT256_MIN = -57896044618658097711785492504343953926634992332820282019728792003956564819968; 10 | ``` 11 | 12 | 13 | ## Functions 14 | ### abs 15 | 16 | 17 | ```solidity 18 | function abs(int256 a) internal pure returns (uint256); 19 | ``` 20 | 21 | ### delta 22 | 23 | 24 | ```solidity 25 | function delta(uint256 a, uint256 b) internal pure returns (uint256); 26 | ``` 27 | 28 | ### delta 29 | 30 | 31 | ```solidity 32 | function delta(int256 a, int256 b) internal pure returns (uint256); 33 | ``` 34 | 35 | ### percentDelta 36 | 37 | 38 | ```solidity 39 | function percentDelta(uint256 a, uint256 b) internal pure returns (uint256); 40 | ``` 41 | 42 | ### percentDelta 43 | 44 | 45 | ```solidity 46 | function percentDelta(int256 a, int256 b) internal pure returns (uint256); 47 | ``` 48 | 49 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Bundle.md: -------------------------------------------------------------------------------- 1 | # Bundle 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Bundle { 11 | string name; 12 | Function[] functions; 13 | address facade; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.BundleRegistry.md: -------------------------------------------------------------------------------- 1 | # BundleRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct BundleRegistry { 11 | mapping(string name => Bundle) bundles; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.ConfigState.md: -------------------------------------------------------------------------------- 1 | # ConfigState 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | ---------------------- 5 | 📝 Config 6 | ------------------------ 7 | ===============\ 8 | | 📝 Config | 9 | \================ 10 | 11 | **Note:** 12 | erc7201:mc.devkit.config 13 | 14 | 15 | ```solidity 16 | struct ConfigState { 17 | SetupConfig SETUP; 18 | SystemConfig SYSTEM; 19 | NamingConfig DEFAULT_NAME; 20 | } 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Current.md: -------------------------------------------------------------------------------- 1 | # Current 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Current { 11 | string name; 12 | } 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.DictionaryRegistry.md: -------------------------------------------------------------------------------- 1 | # DictionaryRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct DictionaryRegistry { 11 | mapping(string name => Dictionary_1) dictionaries; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Dictionary_1.md: -------------------------------------------------------------------------------- 1 | # Dictionary_1 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Dictionary_1 { 11 | string name; 12 | address addr; 13 | DictionaryKind kind; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.FindData.md: -------------------------------------------------------------------------------- 1 | # FindData 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct FindData { 7 | uint256 slot; 8 | uint256 offsetLeft; 9 | uint256 offsetRight; 10 | bool found; 11 | } 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Function.md: -------------------------------------------------------------------------------- 1 | # Function 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Function { 11 | string name; 12 | bytes4 selector; 13 | address implementation; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.FunctionRegistry.md: -------------------------------------------------------------------------------- 1 | # FunctionRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct FunctionRegistry { 11 | mapping(string name => Function) functions; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.MCDevKit.md: -------------------------------------------------------------------------------- 1 | # MCDevKit 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 🌟 Meta Contract DevKit 5 | 6 | 7 | ```solidity 8 | struct MCDevKit { 9 | StdRegistry std; 10 | FunctionRegistry functions; 11 | BundleRegistry bundle; 12 | DictionaryRegistry dictionary; 13 | ProxyRegistry proxy; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.NamingConfig.md: -------------------------------------------------------------------------------- 1 | # NamingConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct NamingConfig { 7 | string DICTIONARY; 8 | string DICTIONARY_DUPLICATED; 9 | string DICTIONARY_MOCK; 10 | string PROXY; 11 | string PROXY_MOCK; 12 | string BUNDLE; 13 | string FUNCTION; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Process.md: -------------------------------------------------------------------------------- 1 | # Process 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct Process { 7 | string libName; 8 | string funcName; 9 | string params; 10 | uint256 nest; 11 | bool isFinished; 12 | } 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.ProxyRegistry.md: -------------------------------------------------------------------------------- 1 | # ProxyRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct ProxyRegistry { 11 | mapping(string name => Proxy_2) proxies; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Proxy_2.md: -------------------------------------------------------------------------------- 1 | # Proxy_2 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Proxy_2 { 11 | address addr; 12 | ProxyKind kind; 13 | TypeStatus status; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.SetupConfig.md: -------------------------------------------------------------------------------- 1 | # SetupConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct SetupConfig { 7 | bool STD_FUNCS; 8 | } 9 | ``` 10 | 11 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.StdFunctions.md: -------------------------------------------------------------------------------- 1 | # StdFunctions 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct StdFunctions { 11 | Function initSetAdmin; 12 | Function getFunctions; 13 | Function clone; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.StdRegistry.md: -------------------------------------------------------------------------------- 1 | # StdRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct StdRegistry { 11 | StdFunctions functions; 12 | Bundle all; 13 | TypeStatus status; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.StdStorage.md: -------------------------------------------------------------------------------- 1 | # StdStorage 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct StdStorage { 7 | mapping(address => mapping(bytes4 => mapping(bytes32 => FindData))) finds; 8 | bytes32[] _keys; 9 | bytes4 _sig; 10 | uint256 _depth; 11 | address _target; 12 | bytes32 _set; 13 | bool _enable_packed_slots; 14 | bytes _calldata; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.SystemConfig.md: -------------------------------------------------------------------------------- 1 | # SystemConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | 5 | ```solidity 6 | struct SystemConfig { 7 | Logger.Level LOG_LEVEL; 8 | uint256 SCAN_RANGE; 9 | } 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/Flattened.sol/struct.Trace.md: -------------------------------------------------------------------------------- 1 | # Trace 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/Flattened.sol) 3 | 4 | ================= 5 | ⛓️ Process 6 | =================== 7 | 8 | **Note:** 9 | erc7201:mc.devkit.tracer 10 | 11 | 12 | ```solidity 13 | struct Trace { 14 | Process[] processStack; 15 | uint256 nextPid; 16 | uint256 currentNest; 17 | } 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCBase.sol/abstract.MCBase.md: -------------------------------------------------------------------------------- 1 | # MCBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCBase.sol) 3 | 4 | **Inherits:** 5 | [CommonBase](../Flattened.sol/abstract.CommonBase.md) 6 | 7 | 8 | ## State Variables 9 | ### mc 10 | 11 | ```solidity 12 | MCDevKit internal mc; 13 | ``` 14 | 15 | 16 | ### deployerKey 17 | 18 | ```solidity 19 | uint256 internal deployerKey; 20 | ``` 21 | 22 | 23 | ### deployer 24 | 25 | ```solidity 26 | address internal deployer; 27 | ``` 28 | 29 | 30 | ## Functions 31 | ### constructor 32 | 33 | 34 | ```solidity 35 | constructor(); 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCBase.sol/abstract.MCScriptBase.md: -------------------------------------------------------------------------------- 1 | # MCScriptBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCBase.sol) 3 | 4 | **Inherits:** 5 | [MCBase](../Flattened.sol/abstract.MCBase.md), ForgeScript 6 | 7 | 8 | ## Functions 9 | ### startBroadcastWith 10 | 11 | 12 | ```solidity 13 | modifier startBroadcastWith(string memory envKey); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCBase.sol/abstract.MCTestBase.md: -------------------------------------------------------------------------------- 1 | # MCTestBase 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCBase.sol) 3 | 4 | **Inherits:** 5 | [MCBase](../Flattened.sol/abstract.MCBase.md), ForgeTest 6 | 7 | 8 | ## Functions 9 | ### startPrankWith 10 | 11 | 12 | ```solidity 13 | modifier startPrankWith(string memory envKey); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCBase.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCBase.sol 2 | 3 | 4 | - [abstract.MCScriptBase](./abstract.MCScriptBase.md) 5 | - [abstract.MCBase](./abstract.MCBase.md) 6 | - [abstract.MCTestBase](./abstract.MCTestBase.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCDevKit.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCDevKit.sol 2 | 3 | 4 | - [struct.MCDevKit](./struct.MCDevKit.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCDevKit.sol/struct.MCDevKit.md: -------------------------------------------------------------------------------- 1 | # MCDevKit 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCDevKit.sol) 3 | 4 | 🌟 Meta Contract DevKit 5 | 6 | 7 | ```solidity 8 | struct MCDevKit { 9 | StdRegistry std; 10 | FunctionRegistry functions; 11 | BundleRegistry bundle; 12 | DictionaryRegistry dictionary; 13 | ProxyRegistry proxy; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCScript.sol/abstract.MCScript.md: -------------------------------------------------------------------------------- 1 | # MCScript 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCScript.sol) 3 | 4 | **Inherits:** 5 | [MCScriptBase](../Flattened.sol/abstract.MCScriptBase.md) 6 | 7 | 8 | ## Functions 9 | ### _saveAddrToEnv 10 | 11 | 12 | ```solidity 13 | function _saveAddrToEnv(address addr, string memory envKeyBase) internal; 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCScript.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCScript.sol 2 | 3 | 4 | - [abstract.MCScript](./abstract.MCScript.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCTest.sol/abstract.MCTest.md: -------------------------------------------------------------------------------- 1 | # MCTest 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/MCTest.sol) 3 | 4 | **Inherits:** 5 | [MCTestBase](../Flattened.sol/abstract.MCTestBase.md), OZProxy 6 | 7 | 8 | ## State Variables 9 | ### implementations 10 | 11 | ```solidity 12 | mapping(bytes4 selector => address) implementations; 13 | ``` 14 | 15 | 16 | ### target 17 | 18 | ```solidity 19 | address target = address(this); 20 | ``` 21 | 22 | 23 | ### functions 24 | 25 | ```solidity 26 | Function[] internal functions; 27 | ``` 28 | 29 | 30 | ### dictionary 31 | 32 | ```solidity 33 | address dictionary; 34 | ``` 35 | 36 | 37 | ### receiver 38 | 39 | ```solidity 40 | address receiver = address(new Receive()); 41 | ``` 42 | 43 | 44 | ## Functions 45 | ### _use 46 | 47 | 48 | ```solidity 49 | function _use(bytes4 selector_, address impl_) internal; 50 | ``` 51 | 52 | ### _setDictionary 53 | 54 | 55 | ```solidity 56 | function _setDictionary(address dictionary_) internal; 57 | ``` 58 | 59 | ### _implementation 60 | 61 | 62 | ```solidity 63 | function _implementation() internal view override returns (address implementation); 64 | ``` 65 | 66 | ### receive 67 | 68 | 69 | ```solidity 70 | receive() external payable; 71 | ``` 72 | 73 | ## Structs 74 | ### Function 75 | 76 | ```solidity 77 | struct Function { 78 | bytes4 selector; 79 | address implementation; 80 | } 81 | ``` 82 | 83 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/MCTest.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCTest.sol 2 | 3 | 4 | - [abstract.MCTest](./abstract.MCTest.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Bundle.sol/index.md: -------------------------------------------------------------------------------- 1 | # Bundle.sol 2 | 3 | 4 | - [library.BundleLib](./library.BundleLib.md) 5 | - [struct.Bundle](./struct.Bundle.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Bundle.sol/library.BundleLib.md: -------------------------------------------------------------------------------- 1 | # BundleLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Bundle.sol) 3 | 4 | 5 | ## Functions 6 | ### assignName 7 | 8 | -------------------- 9 | 📛 Assign Name 10 | ---------------------- 11 | 12 | 13 | ```solidity 14 | function assignName(Bundle storage bundle, string memory name) internal returns (Bundle storage); 15 | ``` 16 | 17 | ### pushFunction 18 | 19 | ------------------------- 20 | 🧩 Push Function(s) 21 | --------------------------- 22 | 23 | 24 | ```solidity 25 | function pushFunction(Bundle storage bundle, Function storage func) internal returns (Bundle storage); 26 | ``` 27 | 28 | ### pushFunctions 29 | 30 | 31 | ```solidity 32 | function pushFunctions(Bundle storage bundle, Function[] storage functions) internal returns (Bundle storage); 33 | ``` 34 | 35 | ### assignFacade 36 | 37 | ---------------------- 38 | 🪟 Assign Facade 39 | ------------------------ 40 | 41 | 42 | ```solidity 43 | function assignFacade(Bundle storage bundle, address facade) internal returns (Bundle storage); 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Bundle.sol/struct.Bundle.md: -------------------------------------------------------------------------------- 1 | # Bundle 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Bundle.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Bundle { 11 | string name; 12 | Function[] functions; 13 | address facade; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Dictionary.sol/enum.DictionaryKind.md: -------------------------------------------------------------------------------- 1 | # DictionaryKind 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Dictionary.sol) 3 | 4 | -------------------- 5 | Dictionary Kind 6 | ---------------------- 7 | 8 | 9 | ```solidity 10 | enum DictionaryKind { 11 | undefined, 12 | Verifiable, 13 | Immutable, 14 | Beacon, 15 | Mock 16 | } 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Dictionary.sol/index.md: -------------------------------------------------------------------------------- 1 | # Dictionary.sol 2 | 3 | 4 | - [library.DictionaryLib](./library.DictionaryLib.md) 5 | - [enum.DictionaryKind](./enum.DictionaryKind.md) 6 | - [struct.Dictionary](./struct.Dictionary.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Dictionary.sol/struct.Dictionary.md: -------------------------------------------------------------------------------- 1 | # Dictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Dictionary.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Dictionary { 11 | string name; 12 | address addr; 13 | DictionaryKind kind; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Function.sol/index.md: -------------------------------------------------------------------------------- 1 | # Function.sol 2 | 3 | 4 | - [struct.Function](./struct.Function.md) 5 | - [library.FunctionLib](./library.FunctionLib.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Function.sol/struct.Function.md: -------------------------------------------------------------------------------- 1 | # Function 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Function.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Function { 11 | string name; 12 | bytes4 selector; 13 | address implementation; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Proxy.sol/enum.ProxyKind.md: -------------------------------------------------------------------------------- 1 | # ProxyKind 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Proxy.sol) 3 | 4 | --------------- 5 | Proxy Kind 6 | ----------------- 7 | 8 | 9 | ```solidity 10 | enum ProxyKind { 11 | undefined, 12 | Normal, 13 | Verifiable, 14 | Mock 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Proxy.sol/index.md: -------------------------------------------------------------------------------- 1 | # Proxy.sol 2 | 3 | 4 | - [struct.Proxy](./struct.Proxy.md) 5 | - [enum.ProxyKind](./enum.ProxyKind.md) 6 | - [library.ProxyLib](./library.ProxyLib.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Proxy.sol/library.ProxyLib.md: -------------------------------------------------------------------------------- 1 | # ProxyLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Proxy.sol) 3 | 4 | 5 | ## Functions 6 | ### deploy 7 | 8 | --------------------- 9 | 🚀 Deploy Proxy 10 | ----------------------- 11 | 12 | 13 | ```solidity 14 | function deploy(Dictionary memory dictionary, bytes memory initData) internal returns (Proxy memory proxy); 15 | ``` 16 | 17 | ### createSimpleMock 18 | 19 | -------------------------- 20 | 🤖 Create Proxy Mock 21 | ---------------------------- 22 | 23 | 24 | ```solidity 25 | function createSimpleMock(Function[] memory functions) internal returns (Proxy memory mockProxy); 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/Proxy.sol/struct.Proxy.md: -------------------------------------------------------------------------------- 1 | # Proxy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/core/Proxy.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Proxy { 11 | address addr; 12 | ProxyKind kind; 13 | TypeStatus status; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/core/index.md: -------------------------------------------------------------------------------- 1 | # Core 2 | 3 | 4 | - [Bundle](./Bundle.sol/struct.Bundle.md) 5 | - [BundleLib](./Bundle.sol/library.BundleLib.md) 6 | - [Dictionary](./Dictionary.sol/struct.Dictionary.md) 7 | - [DictionaryLib](./Dictionary.sol/library.DictionaryLib.md) 8 | - [DictionaryKind](./Dictionary.sol/enum.DictionaryKind.md) 9 | - [Function](./Function.sol/struct.Function.md) 10 | - [FunctionLib](./Function.sol/library.FunctionLib.md) 11 | - [Proxy](./Proxy.sol/struct.Proxy.md) 12 | - [ProxyLib](./Proxy.sol/library.ProxyLib.md) 13 | - [ProxyKind](./Proxy.sol/enum.ProxyKind.md) 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/BundleRegistry.sol/index.md: -------------------------------------------------------------------------------- 1 | # BundleRegistry.sol 2 | 3 | 4 | - [struct.BundleRegistry](./struct.BundleRegistry.md) 5 | - [library.BundleRegistryLib](./library.BundleRegistryLib.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/BundleRegistry.sol/library.BundleRegistryLib.md: -------------------------------------------------------------------------------- 1 | # BundleRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/BundleRegistry.sol) 3 | 4 | 5 | ## Functions 6 | ### init 7 | 8 | --------------------- 9 | 🌱 Init Bundle 10 | ----------------------- 11 | 12 | 13 | ```solidity 14 | function init(BundleRegistry storage registry, string memory name) internal returns (BundleRegistry storage); 15 | ``` 16 | 17 | ### ensureInit 18 | 19 | 20 | ```solidity 21 | function ensureInit(BundleRegistry storage registry) internal returns (BundleRegistry storage); 22 | ``` 23 | 24 | ### find 25 | 26 | -------------------- 27 | 🔍 Find Bundle 28 | ---------------------- 29 | 30 | 31 | ```solidity 32 | function find(BundleRegistry storage registry, string memory name) internal returns (Bundle storage bundle); 33 | ``` 34 | 35 | ### findCurrent 36 | 37 | 38 | ```solidity 39 | function findCurrent(BundleRegistry storage registry) internal returns (Bundle storage bundle); 40 | ``` 41 | 42 | ### genUniqueName 43 | 44 | ----------------------------- 45 | 🏷 Generate Unique Name 46 | ------------------------------- 47 | 48 | 49 | ```solidity 50 | function genUniqueName(BundleRegistry storage registry) internal returns (string memory name); 51 | ``` 52 | 53 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/BundleRegistry.sol/struct.BundleRegistry.md: -------------------------------------------------------------------------------- 1 | # BundleRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/BundleRegistry.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct BundleRegistry { 11 | mapping(string name => Bundle) bundles; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/DictionaryRegistry.sol/index.md: -------------------------------------------------------------------------------- 1 | # DictionaryRegistry.sol 2 | 3 | 4 | - [library.DictionaryRegistryLib](./library.DictionaryRegistryLib.md) 5 | - [struct.DictionaryRegistry](./struct.DictionaryRegistry.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/DictionaryRegistry.sol/struct.DictionaryRegistry.md: -------------------------------------------------------------------------------- 1 | # DictionaryRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/DictionaryRegistry.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct DictionaryRegistry { 11 | mapping(string name => Dictionary) dictionaries; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/FunctionRegistry.sol/index.md: -------------------------------------------------------------------------------- 1 | # FunctionRegistry.sol 2 | 3 | 4 | - [library.FunctionRegistryLib](./library.FunctionRegistryLib.md) 5 | - [struct.FunctionRegistry](./struct.FunctionRegistry.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/FunctionRegistry.sol/library.FunctionRegistryLib.md: -------------------------------------------------------------------------------- 1 | # FunctionRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/FunctionRegistry.sol) 3 | 4 | 5 | ## Functions 6 | ### register 7 | 8 | -------------------------- 9 | 🗳️ Register Function 10 | ---------------------------- 11 | 12 | 13 | ```solidity 14 | function register(FunctionRegistry storage registry, string memory name, bytes4 selector, address implementation) 15 | internal 16 | returns (FunctionRegistry storage); 17 | ``` 18 | 19 | ### find 20 | 21 | ---------------------- 22 | 🔍 Find Function 23 | ------------------------ 24 | 25 | 26 | ```solidity 27 | function find(FunctionRegistry storage registry, string memory name) internal returns (Function storage func); 28 | ``` 29 | 30 | ### findCurrent 31 | 32 | 33 | ```solidity 34 | function findCurrent(FunctionRegistry storage registry) internal returns (Function storage func); 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/FunctionRegistry.sol/struct.FunctionRegistry.md: -------------------------------------------------------------------------------- 1 | # FunctionRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/FunctionRegistry.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct FunctionRegistry { 11 | mapping(string name => Function) functions; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/ProxyRegistry.sol/index.md: -------------------------------------------------------------------------------- 1 | # ProxyRegistry.sol 2 | 3 | 4 | - [struct.ProxyRegistry](./struct.ProxyRegistry.md) 5 | - [library.ProxyRegistryLib](./library.ProxyRegistryLib.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/ProxyRegistry.sol/library.ProxyRegistryLib.md: -------------------------------------------------------------------------------- 1 | # ProxyRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/ProxyRegistry.sol) 3 | 4 | 5 | ## Functions 6 | ### register 7 | 8 | ----------------------- 9 | 🗳️ Register Proxy 10 | ------------------------- 11 | 12 | 13 | ```solidity 14 | function register(ProxyRegistry storage registry, string memory name, Proxy memory _proxy) 15 | internal 16 | returns (Proxy storage proxy); 17 | ``` 18 | 19 | ### find 20 | 21 | ------------------- 22 | 🔍 Find Proxy 23 | --------------------- 24 | 25 | 26 | ```solidity 27 | function find(ProxyRegistry storage registry, string memory name) internal returns (Proxy storage proxy); 28 | ``` 29 | 30 | ### findCurrent 31 | 32 | 33 | ```solidity 34 | function findCurrent(ProxyRegistry storage registry) internal returns (Proxy storage proxy); 35 | ``` 36 | 37 | ### genUniqueName 38 | 39 | ----------------------------- 40 | 🏷 Generate Unique Name 41 | ------------------------------- 42 | 43 | 44 | ```solidity 45 | function genUniqueName(ProxyRegistry storage registry) internal returns (string memory name); 46 | ``` 47 | 48 | ### genUniqueMockName 49 | 50 | 51 | ```solidity 52 | function genUniqueMockName(ProxyRegistry storage registry, string memory baseName) 53 | internal 54 | returns (string memory name); 55 | ``` 56 | 57 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/ProxyRegistry.sol/struct.ProxyRegistry.md: -------------------------------------------------------------------------------- 1 | # ProxyRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/ProxyRegistry.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct ProxyRegistry { 11 | mapping(string name => Proxy) proxies; 12 | Current current; 13 | } 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdFunctions.sol/index.md: -------------------------------------------------------------------------------- 1 | # StdFunctions.sol 2 | 3 | 4 | - [library.StdFunctionsLib](./library.StdFunctionsLib.md) 5 | - [struct.StdFunctions](./struct.StdFunctions.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdFunctions.sol/struct.StdFunctions.md: -------------------------------------------------------------------------------- 1 | # StdFunctions 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/StdFunctions.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct StdFunctions { 11 | Function initSetAdmin; 12 | Function getFunctions; 13 | Function clone; 14 | TypeStatus status; 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdRegistry.sol/index.md: -------------------------------------------------------------------------------- 1 | # StdRegistry.sol 2 | 3 | 4 | - [struct.StdRegistry](./struct.StdRegistry.md) 5 | - [library.StdFunctionsArgs](./library.StdFunctionsArgs.md) 6 | - [library.StdRegistryLib](./library.StdRegistryLib.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdRegistry.sol/library.StdFunctionsArgs.md: -------------------------------------------------------------------------------- 1 | # StdFunctionsArgs 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/StdRegistry.sol) 3 | 4 | 🧩 Std Ops Primitive Utils for Arguments 5 | 6 | 7 | ## Functions 8 | ### initSetAdminBytes 9 | 10 | 11 | ```solidity 12 | function initSetAdminBytes(address admin) internal pure returns (bytes memory); 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdRegistry.sol/library.StdRegistryLib.md: -------------------------------------------------------------------------------- 1 | # StdRegistryLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/StdRegistry.sol) 3 | 4 | 5 | ## Functions 6 | ### complete 7 | 8 | ---------------------------------- 9 | 🟢 Complete Standard Registry 10 | ------------------------------------ 11 | 12 | 13 | ```solidity 14 | function complete(StdRegistry storage registry) internal returns (StdRegistry storage); 15 | ``` 16 | 17 | ### configureStdBundle 18 | 19 | ---------------------------------- 20 | 🔧 Configure Standard Bundles 21 | ------------------------------------ 22 | 23 | 24 | ```solidity 25 | function configureStdBundle(StdRegistry storage registry) internal returns (StdRegistry storage); 26 | ``` 27 | 28 | ### configureStdBundle_All 29 | 30 | ===== Each Std Bundle ===== 31 | 32 | 33 | ```solidity 34 | function configureStdBundle_All(StdRegistry storage registry) internal returns (StdRegistry storage); 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/StdRegistry.sol/struct.StdRegistry.md: -------------------------------------------------------------------------------- 1 | # StdRegistry 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/StdRegistry.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct StdRegistry { 11 | StdFunctions functions; 12 | Bundle all; 13 | TypeStatus status; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/context/Current.sol/index.md: -------------------------------------------------------------------------------- 1 | # Current.sol 2 | 3 | 4 | - [library.CurrentLib](./library.CurrentLib.md) 5 | - [struct.Current](./struct.Current.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/context/Current.sol/library.CurrentLib.md: -------------------------------------------------------------------------------- 1 | # CurrentLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/context/Current.sol) 3 | 4 | 5 | ## Functions 6 | ### update 7 | 8 | ------------------------------- 9 | 🔄 Update Current Context 10 | --------------------------------- 11 | 12 | 13 | ```solidity 14 | function update(Current storage current, string memory name) internal; 15 | ``` 16 | 17 | ### reset 18 | 19 | ------------------------------ 20 | 🧹 Reset Current Context 21 | -------------------------------- 22 | 23 | 24 | ```solidity 25 | function reset(Current storage current) internal; 26 | ``` 27 | 28 | ### find 29 | 30 | ------------------ 31 | 🔍 Find Name 32 | -------------------- 33 | 34 | 35 | ```solidity 36 | function find(Current storage current) internal returns (string memory name); 37 | ``` 38 | 39 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/context/Current.sol/struct.Current.md: -------------------------------------------------------------------------------- 1 | # Current 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/registry/context/Current.sol) 3 | 4 | --------------------- 5 | Support Methods 6 | ----------------------- 7 | 8 | 9 | ```solidity 10 | struct Current { 11 | string name; 12 | } 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/context/index.md: -------------------------------------------------------------------------------- 1 | # Context 2 | 3 | 4 | - [Current](./Current.sol/struct.Current.md) 5 | - [CurrentLib](./Current.sol/library.CurrentLib.md) 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/registry/index.md: -------------------------------------------------------------------------------- 1 | # Registry 2 | 3 | 4 | - [context](./context/index.md) 5 | - [BundleRegistry](./BundleRegistry.sol/struct.BundleRegistry.md) 6 | - [BundleRegistryLib](./BundleRegistry.sol/library.BundleRegistryLib.md) 7 | - [DictionaryRegistry](./DictionaryRegistry.sol/struct.DictionaryRegistry.md) 8 | - [DictionaryRegistryLib](./DictionaryRegistry.sol/library.DictionaryRegistryLib.md) 9 | - [FunctionRegistry](./FunctionRegistry.sol/struct.FunctionRegistry.md) 10 | - [FunctionRegistryLib](./FunctionRegistry.sol/library.FunctionRegistryLib.md) 11 | - [ProxyRegistry](./ProxyRegistry.sol/struct.ProxyRegistry.md) 12 | - [ProxyRegistryLib](./ProxyRegistry.sol/library.ProxyRegistryLib.md) 13 | - [StdFunctions](./StdFunctions.sol/struct.StdFunctions.md) 14 | - [StdFunctionsLib](./StdFunctions.sol/library.StdFunctionsLib.md) 15 | - [StdRegistry](./StdRegistry.sol/struct.StdRegistry.md) 16 | - [StdRegistryLib](./StdRegistry.sol/library.StdRegistryLib.md) 17 | - [StdFunctionsArgs](./StdRegistry.sol/library.StdFunctionsArgs.md) 18 | 19 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/index.md: -------------------------------------------------------------------------------- 1 | # Config.sol 2 | 3 | 4 | - [library.ConfigLib](./library.ConfigLib.md) 5 | - [struct.ConfigState](./struct.ConfigState.md) 6 | - [struct.SystemConfig](./struct.SystemConfig.md) 7 | - [struct.SetupConfig](./struct.SetupConfig.md) 8 | - [struct.NamingConfig](./struct.NamingConfig.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/library.ConfigLib.md: -------------------------------------------------------------------------------- 1 | # ConfigLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Config.sol) 3 | 4 | 5 | ## Functions 6 | ### load 7 | 8 | 9 | ```solidity 10 | function load(ConfigState storage config) internal; 11 | ``` 12 | 13 | ### loadFromLibMC 14 | 15 | 16 | ```solidity 17 | function loadFromLibMC(ConfigState storage config) internal; 18 | ``` 19 | 20 | ### loadFromProjectRoot 21 | 22 | 23 | ```solidity 24 | function loadFromProjectRoot(ConfigState storage config) internal; 25 | ``` 26 | 27 | ### loadFrom 28 | 29 | 30 | ```solidity 31 | function loadFrom(ConfigState storage config, string memory path) internal; 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/struct.ConfigState.md: -------------------------------------------------------------------------------- 1 | # ConfigState 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Config.sol) 3 | 4 | ---------------------- 5 | 📝 Config 6 | ------------------------ 7 | ===============\ 8 | | 📝 Config | 9 | \================ 10 | 11 | **Note:** 12 | erc7201:mc.devkit.config 13 | 14 | 15 | ```solidity 16 | struct ConfigState { 17 | SetupConfig SETUP; 18 | SystemConfig SYSTEM; 19 | NamingConfig DEFAULT_NAME; 20 | } 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/struct.NamingConfig.md: -------------------------------------------------------------------------------- 1 | # NamingConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Config.sol) 3 | 4 | 5 | ```solidity 6 | struct NamingConfig { 7 | string DICTIONARY; 8 | string DICTIONARY_DUPLICATED; 9 | string DICTIONARY_MOCK; 10 | string PROXY; 11 | string PROXY_MOCK; 12 | string BUNDLE; 13 | string FUNCTION; 14 | } 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/struct.SetupConfig.md: -------------------------------------------------------------------------------- 1 | # SetupConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Config.sol) 3 | 4 | 5 | ```solidity 6 | struct SetupConfig { 7 | bool STD_FUNCS; 8 | } 9 | ``` 10 | 11 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Config.sol/struct.SystemConfig.md: -------------------------------------------------------------------------------- 1 | # SystemConfig 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Config.sol) 3 | 4 | 5 | ```solidity 6 | struct SystemConfig { 7 | Logger.Level LOG_LEVEL; 8 | uint256 SCAN_RANGE; 9 | } 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Logger.sol/index.md: -------------------------------------------------------------------------------- 1 | # Logger.sol 2 | 3 | 4 | - [library.Logger](./library.Logger.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/System.sol/index.md: -------------------------------------------------------------------------------- 1 | # System.sol 2 | 3 | 4 | - [library.System](./library.System.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/System.sol/library.System.md: -------------------------------------------------------------------------------- 1 | # System 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/System.sol) 3 | 4 | ===============\ 5 | | 💻 System | 6 | \================ 7 | 8 | 9 | ## Functions 10 | ### Config 11 | 12 | 13 | ```solidity 14 | function Config() internal pure returns (ConfigState storage ref); 15 | ``` 16 | 17 | ### Tracer 18 | 19 | 20 | ```solidity 21 | function Tracer() internal pure returns (Trace storage ref); 22 | ``` 23 | 24 | ### Exit 25 | 26 | 27 | ```solidity 28 | function Exit(string memory errorHead, string memory errorDetail) internal view; 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Tracer.sol/index.md: -------------------------------------------------------------------------------- 1 | # Tracer.sol 2 | 3 | 4 | - [function.param](./function.param.md) 5 | - [struct.Process](./struct.Process.md) 6 | - [struct.Trace](./struct.Trace.md) 7 | - [library.Tracer](./library.Tracer.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Tracer.sol/struct.Process.md: -------------------------------------------------------------------------------- 1 | # Process 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Tracer.sol) 3 | 4 | 5 | ```solidity 6 | struct Process { 7 | string libName; 8 | string funcName; 9 | string params; 10 | uint256 nest; 11 | bool isFinished; 12 | } 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Tracer.sol/struct.Trace.md: -------------------------------------------------------------------------------- 1 | # Trace 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/system/Tracer.sol) 3 | 4 | ================= 5 | ⛓️ Process 6 | =================== 7 | 8 | **Note:** 9 | erc7201:mc.devkit.tracer 10 | 11 | 12 | ```solidity 13 | struct Trace { 14 | Process[] processStack; 15 | uint256 nextPid; 16 | uint256 currentNest; 17 | } 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/Validator.sol/index.md: -------------------------------------------------------------------------------- 1 | # Validator.sol 2 | 3 | 4 | - [library.Validator](./library.Validator.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/index.md: -------------------------------------------------------------------------------- 1 | # System 2 | 3 | 4 | - [message](./message/index.md) 5 | - [ConfigState](./Config.sol/struct.ConfigState.md) 6 | - [SetupConfig](./Config.sol/struct.SetupConfig.md) 7 | - [SystemConfig](./Config.sol/struct.SystemConfig.md) 8 | - [NamingConfig](./Config.sol/struct.NamingConfig.md) 9 | - [ConfigLib](./Config.sol/library.ConfigLib.md) 10 | - [Logger](./Logger.sol/library.Logger.md) 11 | - [System](./System.sol/library.System.md) 12 | - [Trace](./Tracer.sol/struct.Trace.md) 13 | - [Process](./Tracer.sol/struct.Process.md) 14 | - [Tracer](./Tracer.sol/library.Tracer.md) 15 | - [param](./Tracer.sol/function.param.md) 16 | - [Validator](./Validator.sol/library.Validator.md) 17 | 18 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/message/DecodeErrorString.sol/index.md: -------------------------------------------------------------------------------- 1 | # DecodeErrorString.sol 2 | 3 | 4 | - [library.DecodeErrorString](./library.DecodeErrorString.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/message/MessageBody.sol/index.md: -------------------------------------------------------------------------------- 1 | # MessageBody.sol 2 | 3 | 4 | - [library.MessageBody](./library.MessageBody.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/message/MessageHead.sol/index.md: -------------------------------------------------------------------------------- 1 | # MessageHead.sol 2 | 3 | 4 | - [library.MessageHead](./library.MessageHead.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/system/message/index.md: -------------------------------------------------------------------------------- 1 | # Message 2 | 3 | 4 | - [DecodeErrorString](./DecodeErrorString.sol/library.DecodeErrorString.md) 5 | - [MessageBody](./MessageBody.sol/library.MessageBody.md) 6 | - [MessageHead](./MessageHead.sol/library.MessageHead.md) 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/Dummy.sol/index.md: -------------------------------------------------------------------------------- 1 | # Dummy.sol 2 | 3 | 4 | - [library.Dummy](./library.Dummy.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/Dummy.sol/library.Dummy.md: -------------------------------------------------------------------------------- 1 | # Dummy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/dummy/Dummy.sol) 3 | 4 | 5 | ## Functions 6 | ### bundleName 7 | 8 | 9 | ```solidity 10 | function bundleName() internal pure returns (string memory); 11 | ``` 12 | 13 | ### functionSelector 14 | 15 | 16 | ```solidity 17 | function functionSelector() internal pure returns (bytes4); 18 | ``` 19 | 20 | ### functionAddress 21 | 22 | 23 | ```solidity 24 | function functionAddress() internal returns (address); 25 | ``` 26 | 27 | ### facadeAddress 28 | 29 | 30 | ```solidity 31 | function facadeAddress() internal returns (address); 32 | ``` 33 | 34 | ### setBundle 35 | 36 | 37 | ```solidity 38 | function setBundle(MCDevKit storage mc) internal; 39 | ``` 40 | 41 | ### dictionary 42 | 43 | 44 | ```solidity 45 | function dictionary(MCDevKit storage mc) internal returns (address); 46 | ``` 47 | 48 | ### dictionary 49 | 50 | 51 | ```solidity 52 | function dictionary(MCDevKit storage mc, MCTest.Function[] memory functions) internal returns (address); 53 | ``` 54 | 55 | ### contractAddr 56 | 57 | 58 | ```solidity 59 | function contractAddr() internal returns (address); 60 | ``` 61 | 62 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyContract.sol/contract.DummyContract.md: -------------------------------------------------------------------------------- 1 | # DummyContract 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/dummy/DummyContract.sol) 3 | 4 | 5 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyContract.sol/index.md: -------------------------------------------------------------------------------- 1 | # DummyContract.sol 2 | 3 | 4 | - [contract.DummyContract](./contract.DummyContract.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyFacade.sol/contract.DummyFacade.md: -------------------------------------------------------------------------------- 1 | # DummyFacade 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/dummy/DummyFacade.sol) 3 | 4 | 5 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyFacade.sol/index.md: -------------------------------------------------------------------------------- 1 | # DummyFacade.sol 2 | 3 | 4 | - [contract.DummyFacade](./contract.DummyFacade.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyFunction.sol/contract.DummyFunction.md: -------------------------------------------------------------------------------- 1 | # DummyFunction 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/dummy/DummyFunction.sol) 3 | 4 | 5 | ## Functions 6 | ### dummy 7 | 8 | 9 | ```solidity 10 | function dummy() external; 11 | ``` 12 | 13 | ### dummy2 14 | 15 | 16 | ```solidity 17 | function dummy2() external; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/DummyFunction.sol/index.md: -------------------------------------------------------------------------------- 1 | # DummyFunction.sol 2 | 3 | 4 | - [contract.DummyFunction](./contract.DummyFunction.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/dummy/index.md: -------------------------------------------------------------------------------- 1 | # Dummy 2 | 3 | 4 | - [Dummy](./Dummy.sol/library.Dummy.md) 5 | - [DummyContract](./DummyContract.sol/contract.DummyContract.md) 6 | - [DummyFacade](./DummyFacade.sol/contract.DummyFacade.md) 7 | - [DummyFunction](./DummyFunction.sol/contract.DummyFunction.md) 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/index.md: -------------------------------------------------------------------------------- 1 | # Test 2 | 3 | 4 | - [dummy](./dummy/index.md) 5 | - [mocks](./mocks/index.md) 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/MockDictionary.sol/contract.MockDictionary.md: -------------------------------------------------------------------------------- 1 | # MockDictionary 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/mocks/MockDictionary.sol) 3 | 4 | **Inherits:** 5 | Dictionary 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(address owner, Function[] memory functions) Dictionary(owner); 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/MockDictionary.sol/index.md: -------------------------------------------------------------------------------- 1 | # MockDictionary.sol 2 | 3 | 4 | - [contract.MockDictionary](./contract.MockDictionary.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/SimpleMockProxy.sol/contract.SimpleMockProxy.md: -------------------------------------------------------------------------------- 1 | # SimpleMockProxy 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/mocks/SimpleMockProxy.sol) 3 | 4 | **Inherits:** 5 | OZProxy 6 | 7 | 8 | ## Functions 9 | ### constructor 10 | 11 | 12 | ```solidity 13 | constructor(Function[] memory functions); 14 | ``` 15 | 16 | ### _implementation 17 | 18 | 19 | ```solidity 20 | function _implementation() internal view override returns (address); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/SimpleMockProxy.sol/index.md: -------------------------------------------------------------------------------- 1 | # SimpleMockProxy.sol 2 | 3 | 4 | - [contract.SimpleMockProxy](./contract.SimpleMockProxy.md) 5 | - [library.SimpleMockProxyLib](./library.SimpleMockProxyLib.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/SimpleMockProxy.sol/library.SimpleMockProxyLib.md: -------------------------------------------------------------------------------- 1 | # SimpleMockProxyLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/test/mocks/SimpleMockProxy.sol) 3 | 4 | 5 | ## State Variables 6 | ### STORAGE_LOCATION 7 | 8 | ```solidity 9 | bytes32 internal constant STORAGE_LOCATION = 0x64a9f0903a8f864d59bc40808555c0090d6ada027fd81884feeb2af9acdbc200; 10 | ``` 11 | 12 | 13 | ## Functions 14 | ### Storage 15 | 16 | 17 | ```solidity 18 | function Storage() internal pure returns (SimpleMockProxyStorage storage ref); 19 | ``` 20 | 21 | ### set 22 | 23 | 24 | ```solidity 25 | function set(bytes4 selector, address implementation) internal; 26 | ``` 27 | 28 | ### getImplementation 29 | 30 | 31 | ```solidity 32 | function getImplementation(bytes4 selector) internal view returns (address); 33 | ``` 34 | 35 | ## Structs 36 | ### SimpleMockProxyStorage 37 | **Note:** 38 | erc7021:mc.mock.proxy 39 | 40 | 41 | ```solidity 42 | struct SimpleMockProxyStorage { 43 | mapping(bytes4 selector => address) implementations; 44 | } 45 | ``` 46 | 47 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/test/mocks/index.md: -------------------------------------------------------------------------------- 1 | # Mocks 2 | 3 | 4 | - [MockDictionary](./MockDictionary.sol/contract.MockDictionary.md) 5 | - [SimpleMockProxy](./SimpleMockProxy.sol/contract.SimpleMockProxy.md) 6 | - [SimpleMockProxyLib](./SimpleMockProxy.sol/library.SimpleMockProxyLib.md) 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/Formatter.sol/index.md: -------------------------------------------------------------------------------- 1 | # Formatter.sol 2 | 3 | 4 | - [library.Formatter](./library.Formatter.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/Inspector.sol/index.md: -------------------------------------------------------------------------------- 1 | # Inspector.sol 2 | 3 | 4 | - [library.Inspector](./library.Inspector.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/Parser.sol/index.md: -------------------------------------------------------------------------------- 1 | # Parser.sol 2 | 3 | 4 | - [library.Parser](./library.Parser.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/Parser.sol/library.Parser.md: -------------------------------------------------------------------------------- 1 | # Parser 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/types/Parser.sol) 3 | 4 | =============== 5 | 🗒️ Parser 6 | ================= 7 | 8 | 9 | ## Functions 10 | ### toLogLevel 11 | 12 | =============== 13 | 📊 Logger 14 | ================= 15 | 16 | 17 | ```solidity 18 | function toLogLevel(string memory str) internal pure returns (Logger.Level); 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/TypeGuard.sol/enum.TypeStatus.md: -------------------------------------------------------------------------------- 1 | # TypeStatus 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/types/TypeGuard.sol) 3 | 4 | 5 | ```solidity 6 | enum TypeStatus { 7 | Uninitialized, 8 | Building, 9 | Built, 10 | Locked 11 | } 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/TypeGuard.sol/index.md: -------------------------------------------------------------------------------- 1 | # TypeGuard.sol 2 | 3 | 4 | - [enum.TypeStatus](./enum.TypeStatus.md) 5 | - [library.TypeGuard](./library.TypeGuard.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/types/index.md: -------------------------------------------------------------------------------- 1 | # Types 2 | 3 | 4 | - [Formatter](./Formatter.sol/library.Formatter.md) 5 | - [Inspector](./Inspector.sol/library.Inspector.md) 6 | - [Parser](./Parser.sol/library.Parser.md) 7 | - [TypeStatus](./TypeGuard.sol/enum.TypeStatus.md) 8 | - [TypeGuard](./TypeGuard.sol/library.TypeGuard.md) 9 | 10 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/ForgeHelper.sol/constants.ForgeHelper.md: -------------------------------------------------------------------------------- 1 | # Constants 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/utils/ForgeHelper.sol) 3 | 4 | ### vm 5 | *address(uint160(uint256(keccak256("hevm cheat code"))));* 6 | 7 | 8 | ```solidity 9 | Vm constant vm = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/ForgeHelper.sol/function.loadAddressFrom.md: -------------------------------------------------------------------------------- 1 | # loadAddressFrom 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/utils/ForgeHelper.sol) 3 | 4 | 5 | ```solidity 6 | function loadAddressFrom(string memory envKey) view returns (address); 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/ForgeHelper.sol/index.md: -------------------------------------------------------------------------------- 1 | # ForgeHelper.sol 2 | 3 | 4 | - [function.loadAddressFrom](./function.loadAddressFrom.md) 5 | - [library.ForgeHelper](./library.ForgeHelper.md) 6 | - [constants.ForgeHelper](./constants.ForgeHelper.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCDeployLib.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCDeployLib.sol 2 | 3 | 4 | - [library.MCDeployLib](./library.MCDeployLib.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCFinderLib.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCFinderLib.sol 2 | 3 | 4 | - [library.MCFinderLib](./library.MCFinderLib.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCFinderLib.sol/library.MCFinderLib.md: -------------------------------------------------------------------------------- 1 | # MCFinderLib 2 | [Git Source](https://github.com/metacontract/mc/blob/main/src/devkit/utils/global/MCFinderLib.sol) 3 | 4 | 🔍 Finder 5 | 🏠 Find Current Proxy Address 6 | 📚 Find Current Dictionary Address 7 | 8 | 9 | ## Functions 10 | ### toProxyAddress 11 | 12 | ---------------------------------- 13 | 🏠 Find Current Proxy Address 14 | ------------------------------------ 15 | 16 | 17 | ```solidity 18 | function toProxyAddress(MCDevKit storage mc) internal returns (address); 19 | ``` 20 | 21 | ### toDictionaryAddress 22 | 23 | ---------------------------------------- 24 | 📚 Find Current Dictionary Address 25 | ------------------------------------------ 26 | 27 | 28 | ```solidity 29 | function toDictionaryAddress(MCDevKit storage mc) internal returns (address); 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCHelpers.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCHelpers.sol 2 | 3 | 4 | - [library.MCHelpers](./library.MCHelpers.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCInitLib.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCInitLib.sol 2 | 3 | 4 | - [library.MCInitLib](./library.MCInitLib.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/MCMockLib.sol/index.md: -------------------------------------------------------------------------------- 1 | # MCMockLib.sol 2 | 3 | 4 | - [library.MCMockLib](./library.MCMockLib.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/global/index.md: -------------------------------------------------------------------------------- 1 | # Global 2 | 3 | 4 | - [MCDeployLib](./MCDeployLib.sol/library.MCDeployLib.md) 5 | - [MCFinderLib](./MCFinderLib.sol/library.MCFinderLib.md) 6 | - [MCHelpers](./MCHelpers.sol/library.MCHelpers.md) 7 | - [MCInitLib](./MCInitLib.sol/library.MCInitLib.md) 8 | - [MCMockLib](./MCMockLib.sol/library.MCMockLib.md) 9 | 10 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/index.md: -------------------------------------------------------------------------------- 1 | # Utils 2 | 3 | 4 | - [global](./global/index.md) 5 | - [mapping](./mapping/index.md) 6 | - [ForgeHelper](./ForgeHelper.sol/library.ForgeHelper.md) 7 | - [loadAddressFrom](./ForgeHelper.sol/function.loadAddressFrom.md) 8 | - [ForgeHelper constants](./ForgeHelper.sol/constants.ForgeHelper.md) 9 | 10 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/mapping/NameGenerator.sol/index.md: -------------------------------------------------------------------------------- 1 | # NameGenerator.sol 2 | 3 | 4 | - [library.NameGenerator](./library.NameGenerator.md) 5 | 6 | 7 | -------------------------------------------------------------------------------- /site/docs/03-api/03-api-details/utils/mapping/index.md: -------------------------------------------------------------------------------- 1 | # mapping 2 | 3 | 4 | - [NameGenerator](./NameGenerator.sol/library.NameGenerator.md) 5 | 6 | -------------------------------------------------------------------------------- /site/docs/03-api/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [devkit, api, usage, best-practices] 3 | tags: [devkit, api, usage, best-practices] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # API Reference 10 | 11 | This section provides the API reference for the Meta Contract DevKit. 12 | 13 | ## Contents 14 | 15 | - [Overview](./01-overview.md) 16 | - [Usage Guide](./02-usage.md) 17 | - [API Details](./03-api-details/index.md) 18 | -------------------------------------------------------------------------------- /site/docs/04-examples/01-dao/01-textdao.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [DAO, example, Solidity] 3 | tags: [DAO, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # TextDAO Example 10 | 11 | This example demonstrates a TextDAO structure in Solidity, including a voting mechanism for proposals and handling votes. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/textdao-monorepo) 14 | 15 | ## Overview 16 | 17 | The TextDAO example demonstrates: 18 | 19 | 1. DAO structure in Solidity 20 | 2. Voting mechanism implementation 21 | 3. Handling proposals and votes 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/01-dao/02-simple-dao.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [DAO, example, Solidity] 3 | tags: [DAO, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Simple DAO Example 10 | 11 | This example demonstrates a simple DAO structure in Solidity, including a voting mechanism for proposals and handling votes. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/simple-dao) 14 | 15 | ## Overview 16 | 17 | The Simple DAO example demonstrates: 18 | 19 | 1. DAO structure in Solidity 20 | 2. Voting mechanism implementation 21 | 3. Handling proposals and votes 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/01-dao/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: DAO 3 | keywords: [DAO, example, Solidity] 4 | tags: [DAO, example, Solidity] 5 | last_update: 6 | date: 2024-10-26 7 | author: Meta Contract Development Team 8 | --- 9 | 10 | # Examples of DAO Implementations 11 | 12 | This section provides examples of implementing various DAO structures, such as TextDAO. 13 | 14 | ## Contents 15 | 16 | - [TextDAO](01-textdao.md) 17 | - [Simple DAO](02-simple-dao.md) 18 | 19 | Each example demonstrates the complete implementation of the respective DAO structure, from code structure to deployment. 20 | -------------------------------------------------------------------------------- /site/docs/04-examples/02-defi/01-stable-credit.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [StableCoin, example, Solidity] 3 | tags: [StableCoin, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Stable Credit Example 10 | 11 | This example demonstrates a stablecoin system using Solidity, including stablecoin issuance and redemption, pegging mechanisms, and credit scoring. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/StableCredit) 14 | 15 | ## Overview 16 | 17 | The Stable Credit example demonstrates: 18 | 19 | 1. Stablecoin issuance and redemption 20 | 2. Pegging mechanisms 21 | 3. Credit scoring and stability mechanisms 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/02-defi/02-simple-dex.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [DEX, example, Solidity] 3 | tags: [DEX, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Simple DEX Example 10 | 11 | This example demonstrates a simple decentralized exchange (DEX) using Solidity, including liquidity pool management and token swapping mechanism. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/forkathon-dex) 14 | 15 | ## Overview 16 | 17 | The Simple DEX example demonstrates: 18 | 19 | 1. Liquidity pool management 20 | 2. Token swapping mechanism 21 | 3. Smart contract interactions with ERC20 tokens 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/02-defi/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: DeFi 3 | keywords: [DeFi, example, Solidity] 4 | tags: [DeFi, example, Solidity] 5 | last_update: 6 | date: 2024-10-26 7 | author: Meta Contract Development Team 8 | --- 9 | 10 | # Examples of DeFi 11 | 12 | This section provides examples of implementing various DeFi protocols, such as lending, borrowing, and staking. 13 | 14 | ## Contents 15 | 16 | - [Stable Credit](01-stable-credit.md) 17 | - [Simple DEX](02-simple-dex.md) 18 | 19 | Each example demonstrates the complete implementation of the respective DeFi protocol, from code structure to deployment. 20 | -------------------------------------------------------------------------------- /site/docs/04-examples/03-erc/01-erc20.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [ERC20, example, Solidity] 3 | tags: [ERC20, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # ERC-20 Example 10 | 11 | This example demonstrates how to implement an ERC20 token using Meta Contract. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/ERC20) 14 | 15 | ## Overview 16 | 17 | The ERC20 example demonstrates: 18 | 19 | 1. Token creation 20 | 2. Transfer and approval mechanics 21 | 3. ERC20 interface implementation 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/03-erc/02-erc721.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [ERC721, example, Solidity] 3 | tags: [ERC721, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # ERC-721 Example 10 | 11 | This example demonstrates how to implement an ERC-721 token using Meta Contract. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/ERC721) 14 | 15 | ## Overview 16 | 17 | The ERC-721 example demonstrates: 18 | 19 | 1. NFT creation 20 | 2. Token metadata and ownership 21 | 3. ERC-721 interface implementation 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/03-erc/03-erc1155.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [ERC1155, example, Solidity] 3 | tags: [ERC1155, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # ERC-1155 Example 10 | 11 | This example demonstrates how to implement an ERC-1155 multi-token standard using Meta Contract. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/ERC1155) 14 | 15 | ## Overview 16 | 17 | The ERC-1155 example demonstrates: 18 | 19 | 1. Multi-token management 20 | 2. Batch transfers 21 | 3. ERC-1155 interface implementation 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/03-erc/04-erc4337.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [ERC4337, example, Solidity] 3 | tags: [ERC4337, example, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # ERC-4337 Example 10 | 11 | This example demonstrates how to implement ERC-4337, focused on account abstraction. 12 | 13 | - [GitHub Repository](https://github.com/ecdysisxyz/ERC4337) 14 | 15 | ## Overview 16 | 17 | The ERC-4337 example demonstrates: 18 | 19 | 1. Account abstraction mechanics 20 | 2. User operations 21 | 3. ERC-4337 interface implementation 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/03-erc/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_label: ERC 3 | keywords: [ERC standards, example, Solidity] 4 | tags: [ERC standards, example, Solidity] 5 | last_update: 6 | date: 2024-10-26 7 | author: Meta Contract Development Team 8 | --- 9 | 10 | # Examples of ERC Implementations 11 | 12 | This section provides examples of implementing various ERC standards, such as ERC-20, ERC-721, ERC-1155, and ERC-4337. 13 | 14 | ## Contents 15 | 16 | - [ERC-20 Example](01-erc20.md) 17 | - [ERC-721 Example](02-erc721.md) 18 | - [ERC-1155 Example](03-erc1155.md) 19 | - [ERC-4337 Example](04-erc4337.md) 20 | 21 | Each example demonstrates the complete implementation of the respective ERC standard, from code structure to deployment. 22 | -------------------------------------------------------------------------------- /site/docs/04-examples/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: [examples, guide, Solidity] 3 | tags: [examples, guide, Solidity] 4 | last_update: 5 | date: 2024-10-26 6 | author: Meta Contract Development Team 7 | --- 8 | 9 | # Examples 10 | 11 | This section contains examples that guide you through various implementations of smart contracts and decentralized applications using the Meta Contract framework. 12 | 13 | ## DAO 14 | 15 | - [TextDAO](./01-dao/01-textdao.md) 16 | - [Simple DAO](./01-dao/02-simple-dao.md) 17 | 18 | ## DeFi 19 | 20 | - [Stable Credit](./02-defi/01-stable-credit.md) 21 | - [Simple DEX](./02-defi/02-simple-dex.md) 22 | 23 | ## ERC Implementations 24 | 25 | - [ERC20 Implementation](./03-erc/01-erc20.md) 26 | - [ERC721 Implementation](./03-erc/02-erc721.md) 27 | - [ERC1155 Implementation](./03-erc/03-erc1155.md) 28 | - [ERC4337 Implementation](./03-erc/04-erc4337.md) 29 | -------------------------------------------------------------------------------- /site/script/config.ts: -------------------------------------------------------------------------------- 1 | import { type Config, defaultConfig } from "./soldocs/utils"; 2 | 3 | export const config: Config = { 4 | ...defaultConfig, 5 | copyPaths: [ 6 | { 7 | from: "src/std/", 8 | to: "02-guides/02-development/03-std-functions/05-std/", 9 | }, 10 | { 11 | from: "src/devkit/", 12 | to: "03-api/03-api-details/", 13 | }, 14 | // { 15 | // from: "lib/ucs-contracts/src/", 16 | // to: "03-api/03-api-details/ucs-contracts/", 17 | // }, 18 | ], 19 | docsDir: "site/docs", 20 | }; 21 | -------------------------------------------------------------------------------- /site/script/generate_temp_soldocs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | command -v forge >/dev/null 2>&1 || { 4 | # Download and install Foundry 5 | curl -L https://foundry.paradigm.xyz | bash 6 | 7 | # Update PATH to include Foundry binaries 8 | export PATH=$HOME/.foundry/bin:$PATH 9 | 10 | # Update Foundry 11 | $HOME/.foundry/bin/foundryup 12 | } 13 | 14 | # Navigate to the parent directory, set PATH, generate docs, and return to site directory 15 | cd .. 16 | forge doc -o temp_soldocs/ 17 | # forge doc -o temp_soldocs/ -i 18 | -------------------------------------------------------------------------------- /site/script/integrate_soldocs.ts: -------------------------------------------------------------------------------- 1 | import { config } from "./config"; 2 | import { generateAndMoveForgeDocs } from "./soldocs/generate_and_move_forge_docs"; 3 | import { updateLinks } from "./soldocs/update_links"; 4 | import { upsertIndexFile } from "./soldocs/upsert_index_file"; 5 | import { 6 | extractPaths, 7 | logSuccess, 8 | processPathsInSubdirectories, 9 | } from "./soldocs/utils"; 10 | 11 | function integrateSolDocs() { 12 | generateAndMoveForgeDocs(); 13 | 14 | processPathsInSubdirectories(extractPaths(config.copyPaths), [ 15 | upsertIndexFile, 16 | updateLinks, 17 | ]); 18 | 19 | logSuccess("Successfully generated Solidity API docs!", true); 20 | } 21 | 22 | integrateSolDocs(); 23 | -------------------------------------------------------------------------------- /site/script/remove_temp_soldocs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # # Check if the file exists 4 | # if [ -f "docs/03-api/03-api-details/Flattened.sol/abstract.CommonBase.md" ]; then 5 | # # Output the contents of the file 6 | # cat docs/03-api/03-api-details/Flattened.sol/abstract.CommonBase.md 7 | # else 8 | # echo "File not found: docs/03-api/03-api-details/Flattened.sol/abstract.CommonBase.md" 9 | # fi 10 | 11 | cd .. 12 | 13 | # # Check if the file exists 14 | # if [ -f "temp_soldocs/src/src/devkit/Flattened.sol/abstract.CommonBase.md" ]; then 15 | # # Output the contents of the file 16 | # cat temp_soldocs/src/src/devkit/Flattened.sol/abstract.CommonBase.md 17 | # else 18 | # echo "File not found: temp_soldocs/src/src/devkit/Flattened.sol/abstract.CommonBase.md" 19 | # fi 20 | 21 | rm -rf temp_soldocs 22 | -------------------------------------------------------------------------------- /site/sidebars.ts: -------------------------------------------------------------------------------- 1 | import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; 2 | 3 | const sidebars: SidebarsConfig = { 4 | sidebar: [ 5 | "getting-started", 6 | { 7 | type: "category", 8 | label: "Concepts", 9 | link: { type: "doc", id: "concepts/index" }, 10 | collapsible: true, 11 | collapsed: false, 12 | items: [{ type: "autogenerated", dirName: "01-concepts" }], 13 | }, 14 | { 15 | type: "category", 16 | label: "Guides", 17 | link: { type: "doc", id: "guides/index" }, 18 | collapsible: true, 19 | collapsed: false, 20 | items: [{ type: "autogenerated", dirName: "02-guides" }], 21 | }, 22 | { 23 | type: "category", 24 | label: "API", 25 | link: { type: "doc", id: "api/index" }, 26 | collapsible: true, 27 | collapsed: false, 28 | items: [{ type: "autogenerated", dirName: "03-api" }], 29 | }, 30 | { 31 | type: "category", 32 | label: "Examples", 33 | link: { type: "doc", id: "examples/index" }, 34 | collapsible: true, 35 | collapsed: false, 36 | items: [{ type: "autogenerated", dirName: "04-examples" }], 37 | }, 38 | // { type: "autogenerated", dirName: "." }, 39 | ], 40 | }; 41 | 42 | export default sidebars; 43 | -------------------------------------------------------------------------------- /site/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/.nojekyll -------------------------------------------------------------------------------- /site/static/img/common/chevron.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/static/img/common/search-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/static/img/common/search-light.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/favicon.ico -------------------------------------------------------------------------------- /site/static/img/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/hero.png -------------------------------------------------------------------------------- /site/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/logo.png -------------------------------------------------------------------------------- /site/static/img/social/github-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/social/github-black.png -------------------------------------------------------------------------------- /site/static/img/social/github-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/social/github-white.png -------------------------------------------------------------------------------- /site/static/img/social/x-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/social/x-black.png -------------------------------------------------------------------------------- /site/static/img/social/x-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metacontract/mc/5e74cf580393b4513307a2e6d322b2f781e6a69e/site/static/img/social/x-white.png -------------------------------------------------------------------------------- /site/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/devkit/Files.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import "./MCBase.sol"; 5 | import "./MCDevKit.sol"; 6 | import "./MCTest.sol"; 7 | import "./MCScript.sol"; 8 | -------------------------------------------------------------------------------- /src/devkit/MCBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | // 🛠 FORGE STD 5 | import {CommonBase} from "forge-std/Base.sol"; 6 | import {Script as ForgeScript} from "forge-std/Script.sol"; 7 | import {Test as ForgeTest} from "forge-std/Test.sol"; 8 | 9 | import {MCDevKit} from "@mc-devkit/MCDevKit.sol"; 10 | import {System} from "@mc-devkit/system/System.sol"; 11 | 12 | abstract contract MCBase is CommonBase { 13 | MCDevKit internal mc; 14 | uint256 internal deployerKey; 15 | address internal deployer; 16 | 17 | constructor() { 18 | System.Config().load(); 19 | } 20 | } 21 | 22 | abstract contract MCScriptBase is MCBase, ForgeScript { 23 | modifier startBroadcastWith(string memory envKey) { 24 | deployerKey = mc.loadPrivateKey(envKey); 25 | deployer = vm.addr(deployerKey); 26 | vm.startBroadcast(deployerKey); 27 | _; 28 | } 29 | } 30 | 31 | abstract contract MCTestBase is MCBase, ForgeTest { 32 | modifier startPrankWith(string memory envKey) { 33 | deployer = vm.envOr(envKey, makeAddr(envKey)); 34 | vm.startPrank(deployer); 35 | _; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/devkit/MCScript.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | // 💬 ABOUT 5 | // Meta Contract's default Script based on Forge Std Script 6 | 7 | // 🛠 FORGE STD INTERFACE 8 | import {VmSafe} from "forge-std/Vm.sol"; 9 | 10 | // 📦 BOILERPLATE 11 | import {MCScriptBase} from "./MCBase.sol"; 12 | 13 | // ⭐️ MC SCRIPT 14 | abstract contract MCScript is MCScriptBase { 15 | function _saveAddrToEnv(address addr, string memory envKeyBase) internal { 16 | if (!vm.isContext(VmSafe.ForgeContext.ScriptBroadcast)) return; 17 | 18 | uint256 _chainId; 19 | assembly { 20 | _chainId := chainid() 21 | } 22 | string memory _chainIdString = vm.toString(_chainId); 23 | 24 | vm.writeLine( 25 | string.concat(vm.projectRoot(), "/.env"), 26 | // forgefmt: disable-start 27 | string.concat( 28 | envKeyBase, 29 | _chainIdString, 30 | "=", 31 | vm.toString(address(addr)) 32 | ) 33 | // forgefmt: disable-end 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/devkit/system/System.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {ConfigState} from "@mc-devkit/system/Config.sol"; 5 | import {Trace} from "@mc-devkit/system/Tracer.sol"; 6 | import {Logger} from "@mc-devkit/system/Logger.sol"; 7 | import {Formatter} from "@mc-devkit/types/Formatter.sol"; 8 | 9 | /** 10 | * ===============\ 11 | * | 💻 System | 12 | * \================ 13 | */ 14 | library System { 15 | function Config() internal pure returns (ConfigState storage ref) { 16 | assembly { ref.slot := 0x43faf0b0e69b78a7870a9a7da6e0bf9d6f14028444e1b48699a33401cb840400 }// forgefmt: disable-line 17 | } 18 | 19 | function Tracer() internal pure returns (Trace storage ref) { 20 | assembly { ref.slot := 0xa49160886909e5e0f01c27589d50ba63eab65b778730b187d2804aa2e50cc900 }// forgefmt: disable-line 21 | } 22 | 23 | function Exit(string memory errorHead, string memory errorDetail) internal view { 24 | Logger.logException(errorHead, errorDetail); 25 | revert(errorHead); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/devkit/test/dummy/DummyContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | contract DummyContract {} 5 | -------------------------------------------------------------------------------- /src/devkit/test/dummy/DummyFacade.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | contract DummyFacade {} 5 | -------------------------------------------------------------------------------- /src/devkit/test/dummy/DummyFunction.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | contract DummyFunction { 5 | function dummy() external {} 6 | function dummy2() external {} 7 | } 8 | -------------------------------------------------------------------------------- /src/devkit/test/mocks/MockDictionary.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | // Core 5 | import {Function} from "@mc-devkit/core/Function.sol"; 6 | // External Lib 7 | import {Dictionary} from "@ucs.mc/dictionary/Dictionary.sol"; 8 | 9 | /** 10 | * @title Mock Dictionary Contract 11 | */ 12 | contract MockDictionary is Dictionary { 13 | constructor(address owner, Function[] memory functions) Dictionary(owner) { 14 | for (uint256 i; i < functions.length; ++i) { 15 | _setImplementation(functions[i].selector, functions[i].implementation); 16 | } 17 | } 18 | } 19 | 20 | // TODO DictionaryWithPermissionsMock.sol 21 | -------------------------------------------------------------------------------- /src/devkit/types/Parser.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {Logger} from "@mc-devkit/system/Logger.sol"; 5 | import {Inspector} from "@mc-devkit/types/Inspector.sol"; 6 | 7 | using Inspector for string; 8 | 9 | /** 10 | * =============== 11 | * 🗒️ Parser 12 | * ================= 13 | */ 14 | library Parser { 15 | /** 16 | * =============== 17 | * 📊 Logger 18 | * ================= 19 | */ 20 | function toLogLevel(string memory str) internal pure returns (Logger.Level) { 21 | if (str.isEqual("Debug")) return Logger.Level.Debug; 22 | if (str.isEqual("Info")) return Logger.Level.Info; 23 | if (str.isEqual("Warn")) return Logger.Level.Warn; 24 | if (str.isEqual("Error")) return Logger.Level.Error; 25 | return Logger.Level.Critical; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/devkit/utils/global/MCFinderLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCDevKit} from "@mc-devkit/MCDevKit.sol"; 5 | // Core 6 | // functions 7 | import {Bundle} from "@mc-devkit/core/Bundle.sol"; 8 | import {Function} from "@mc-devkit/core/Function.sol"; 9 | // proxy 10 | import {Proxy} from "@mc-devkit/core/Proxy.sol"; 11 | // dictionary 12 | import {Dictionary} from "@mc-devkit/core/Dictionary.sol"; 13 | 14 | /** 15 | * 16 | * 🔍 Finder 17 | * 🏠 Find Current Proxy Address 18 | * 📚 Find Current Dictionary Address 19 | * 20 | */ 21 | library MCFinderLib { 22 | /** 23 | * ---------------------------------- 24 | * 🏠 Find Current Proxy Address 25 | * ------------------------------------ 26 | */ 27 | function toProxyAddress(MCDevKit storage mc) internal returns (address) { 28 | return mc.proxy.findCurrent().addr; 29 | } 30 | 31 | /** 32 | * ---------------------------------------- 33 | * 📚 Find Current Dictionary Address 34 | * ------------------------------------------ 35 | */ 36 | function toDictionaryAddress(MCDevKit storage mc) internal returns (address) { 37 | return mc.dictionary.findCurrent().addr; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/std/functions/Clone.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {ProxyCreator} from "./internal/ProxyCreator.sol"; 5 | import {ProxyUtils} from "@ucs.mc/proxy/ProxyUtils.sol"; 6 | 7 | /** 8 | * < MC Standard Function > 9 | * @title Clone 10 | * @custom:version v0.1.0 11 | * @custom:schema none 12 | */ 13 | contract Clone { 14 | /// DO NOT USE STORAGE DIRECTLY !!! 15 | 16 | function clone(bytes calldata initData) external returns (address proxy) { 17 | proxy = ProxyCreator.create(ProxyUtils.getDictionary(), initData); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/std/functions/Create.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {ProxyCreator} from "./internal/ProxyCreator.sol"; 5 | 6 | /** 7 | * < MC Standard Function > 8 | * @title Create 9 | * @custom:version v0.1.0 10 | * @custom:schema none 11 | */ 12 | contract Create { 13 | /// DO NOT USE STORAGE DIRECTLY !!! 14 | 15 | function create(address dictionary, bytes calldata initData) external returns (address proxy) { 16 | proxy = ProxyCreator.create(dictionary, initData); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/std/functions/GetFunctions.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {ProxyUtils} from "@ucs.mc/proxy/ProxyUtils.sol"; 5 | import {IDictionary} from "@ucs.mc/dictionary/interfaces/IDictionary.sol"; 6 | 7 | /** 8 | * < MC Standard Function > 9 | * @title GetFunctions 10 | * @custom:version v0.1.0 11 | * @custom:schema none 12 | */ 13 | contract GetFunctions { 14 | /// DO NOT USE STORAGE DIRECTLY !!! 15 | struct Function { 16 | bytes4 selector; 17 | address implementation; 18 | } 19 | 20 | function getFunctions() external view returns (Function[] memory) { 21 | IDictionary dictionary = IDictionary(ProxyUtils.getDictionary()); 22 | bytes4[] memory selectors = dictionary.supportsInterfaces(); 23 | Function[] memory deps = new Function[](selectors.length); 24 | for (uint256 i; i < selectors.length; ++i) { 25 | deps[i].selector = selectors[i]; 26 | deps[i].implementation = dictionary.getImplementation(selectors[i]); 27 | } 28 | return deps; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/std/functions/Receive.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | /** 5 | * < MC Standard Function > 6 | * @title Receive 7 | * @custom:version v0.1.0 8 | * @custom:schema none 9 | */ 10 | contract Receive { 11 | /// DO NOT USE STORAGE DIRECTLY !!! 12 | 13 | event Received(address from, uint256 amount); 14 | 15 | receive() external payable { 16 | emit Received(msg.sender, msg.value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/std/functions/internal/ProxyCreator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {Proxy} from "@ucs.mc/proxy/Proxy.sol"; 5 | 6 | /** 7 | * < MC Standard Helper Library > 8 | * @title Proxy Creator 9 | * @custom:version v0.1.0 10 | * @custom:schema none 11 | */ 12 | library ProxyCreator { 13 | event ProxyCreated(address dictionary, address proxy); 14 | 15 | function create(address dictionary, bytes memory initData) internal returns (address proxy) { 16 | proxy = address(new Proxy(dictionary, initData)); 17 | emit ProxyCreated(dictionary, proxy); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/std/functions/protected/FeatureToggle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | // storage 5 | import {Storage} from "../../storage/Storage.sol"; 6 | 7 | import {ProtectionBase} from "./protection/ProtectionBase.sol"; 8 | 9 | /** 10 | * < MC Standard Function > 11 | * @title FeatureToggle 12 | * @custom:version 0.1.0 13 | * @custom:schema v0.1.0 14 | */ 15 | contract FeatureToggle is ProtectionBase { 16 | /// DO NOT USE STORAGE DIRECTLY !!! 17 | 18 | function featureToggle(bytes4 selector) external onlyAdmin { 19 | Storage.FeatureToggle().disabledFeature[selector] = !Storage.FeatureToggle().disabledFeature[selector]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/std/functions/protected/InitSetAdmin.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | // storage 5 | import {Storage} from "../../storage/Storage.sol"; 6 | 7 | // predicates 8 | import {ProtectionBase} from "./protection/ProtectionBase.sol"; 9 | 10 | /** 11 | * < MC Standard Function > 12 | * @title InitSetAdmin 13 | * @custom:version v0.1.0 14 | * @custom:schema v0.1.0 15 | */ 16 | contract InitSetAdmin is ProtectionBase { 17 | /// DO NOT USE STORAGE DIRECTLY !!! 18 | 19 | event AdminSet(address admin); 20 | 21 | function initSetAdmin(address admin) external initializer { 22 | Storage.Admin().admin = admin; 23 | emit AdminSet(admin); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/std/functions/protected/UpgradeDictionary.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {ProxyUtils} from "@ucs.mc/proxy/ProxyUtils.sol"; 5 | import {ProtectionBase} from "./protection/ProtectionBase.sol"; 6 | 7 | /** 8 | * < MC Standard Function > 9 | * @title UpgradeDictionary 10 | * @custom:version 0.1.0 11 | * @custom:schema v0.1.0 12 | */ 13 | contract UpgradeDictionary is ProtectionBase { 14 | /// DO NOT USE STORAGE DIRECTLY !!! 15 | 16 | function upgradeDictionary(address newDictionary) external onlyAdmin { 17 | ProxyUtils.upgradeDictionaryToAndCall({newDictionary: newDictionary, data: ""}); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/std/functions/protected/protection/FeatureToggle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {Storage} from "../../../storage/Storage.sol"; 5 | 6 | library FeatureToggle { 7 | error FeatureNotActive(); 8 | 9 | function shouldBeActive(bytes4 selector) internal view { 10 | if (Storage.FeatureToggle().disabledFeature[selector] == true) revert FeatureNotActive(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/std/functions/protected/protection/Initialization.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {Storage} from "../../../storage/Storage.sol"; 5 | 6 | library Initialization { 7 | error InvalidInitialization(); 8 | 9 | function shouldNotBeCompleted() internal view { 10 | if (Storage.Initialization().initialized != 0) revert InvalidInitialization(); 11 | } 12 | 13 | event Initialized(uint64 version); 14 | 15 | function willBeCompleted() internal { 16 | Storage.Initialization().initialized = 1; 17 | emit Initialized(1); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/std/functions/protected/protection/MsgSender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {Storage} from "../../../storage/Storage.sol"; 5 | import {console} from "forge-std/console.sol"; 6 | 7 | library MsgSender { 8 | error NotAdmin(); 9 | 10 | function shouldBeAdmin() internal view { 11 | console.log(msg.sender); 12 | console.log(Storage.Admin().admin); 13 | if (msg.sender != Storage.Admin().admin) revert NotAdmin(); 14 | } 15 | 16 | error NotMember(); 17 | 18 | function shouldBeMember() internal view { 19 | bool _isMember; 20 | address[] memory _members = Storage.Member().members; 21 | for (uint256 i; i < _members.length; ++i) { 22 | if (msg.sender == _members[i]) { 23 | _isMember = true; 24 | break; 25 | } 26 | } 27 | if (!_isMember) revert NotMember(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/std/functions/protected/protection/ProtectionBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {Initialization} from "./Initialization.sol"; 5 | import {MsgSender} from "./MsgSender.sol"; 6 | 7 | abstract contract ProtectionBase { 8 | modifier initializer() { 9 | Initialization.shouldNotBeCompleted(); 10 | _; 11 | Initialization.willBeCompleted(); 12 | } 13 | 14 | modifier onlyAdmin() { 15 | MsgSender.shouldBeMember(); 16 | _; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/std/interfaces/IStd.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {IProxy} from "@ucs.mc/proxy/IProxy.sol"; 5 | import {GetFunctions} from "@mc-std/functions/GetFunctions.sol"; 6 | 7 | interface IStd is IProxy { 8 | function clone(bytes calldata initData) external returns (address proxy); 9 | function getFunctions() external view returns (GetFunctions.Function[] memory); 10 | function featureToggle(bytes4 selector) external; 11 | function initSetAdmin(address admin) external; 12 | function upgradeDictionary(address newDictionary) external; 13 | } 14 | -------------------------------------------------------------------------------- /src/std/interfaces/StdFacade.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {IStd} from "./IStd.sol"; 5 | import {GetFunctions} from "@mc-std/functions/GetFunctions.sol"; 6 | 7 | contract StdFacade is IStd { 8 | function clone(bytes calldata initData) external returns (address proxy) {} 9 | function getFunctions() external view returns (GetFunctions.Function[] memory) {} 10 | function featureToggle(bytes4 selector) external {} 11 | function initSetAdmin(address admin) external {} 12 | function upgradeDictionary(address newDictionary) external {} 13 | } 14 | -------------------------------------------------------------------------------- /test/devkit/MCHelpers.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCTestBase, MessageHead as HEAD, Inspector} from "@mc-devkit/Flattened.sol"; 5 | 6 | contract MCHelpersTest is MCTestBase { 7 | using Inspector for string; 8 | 9 | /** 10 | * ----------------------------- 11 | * ♻️ Reset Current Context 12 | * ------------------------------- 13 | */ 14 | function test_reset_Success() public { 15 | mc.functions.current.name = "Current Function"; 16 | mc.bundle.current.name = "Current Bundle"; 17 | mc.dictionary.current.name = "Current Dictionary"; 18 | mc.proxy.current.name = "Current Proxy"; 19 | 20 | mc.reset(); 21 | 22 | assertTrue(mc.functions.current.name.isEmpty()); 23 | assertTrue(mc.bundle.current.name.isEmpty()); 24 | assertTrue(mc.dictionary.current.name.isEmpty()); 25 | assertTrue(mc.proxy.current.name.isEmpty()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/script/DeployStdDictionary.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTestBase, MCDevKit} from "@mc-devkit/Flattened.sol"; 5 | import {DeployLib} from "../../script/DeployLib.sol"; 6 | 7 | contract DeployStdDictionaryTest is MCTestBase { 8 | using DeployLib for MCDevKit; 9 | 10 | function setUp() public { 11 | mc.std.functions.fetch(); 12 | } 13 | 14 | function test_Run_Success() public startPrankWith("DEPLOYER_PRIV_KEY") { 15 | mc.deployStdDictionary(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/std/Std.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {MCTest, MCDevKit} from "@mc-devkit/Flattened.sol"; 5 | import {DeployLib} from "script/DeployLib.sol"; 6 | 7 | import {IStd} from "@mc-std/interfaces/IStd.sol"; 8 | import {Initialization} from "@mc-std/functions/protected/protection/Initialization.sol"; 9 | 10 | contract StdTest is MCTest { 11 | using DeployLib for MCDevKit; 12 | 13 | IStd std; 14 | 15 | function setUp() public { 16 | mc.setupStdFunctions(); 17 | std = IStd(mc.deployStd(address(this))); 18 | } 19 | 20 | function test_clone_Success() public { 21 | std.clone(""); 22 | } 23 | 24 | function test_getFunctions_Success() public { 25 | std.getFunctions(); 26 | } 27 | 28 | function test_initSetAdmin_Success() public { 29 | IStd uninitializedStd = IStd(std.clone("")); 30 | uninitializedStd.initSetAdmin(makeAddr("ADMIN")); 31 | } 32 | 33 | function test_initSetAdmin_RevertIf_AlreadyInitialized() public { 34 | vm.expectRevert(Initialization.InvalidInitialization.selector); 35 | std.initSetAdmin(makeAddr("ADMIN")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/std/functions/Clone.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest, console, ForgeHelper, Dummy} from "@mc-devkit/Flattened.sol"; 5 | 6 | import {Clone} from "@mc-std/functions/Clone.sol"; 7 | import {ProxyCreator} from "@mc-std/functions/internal/ProxyCreator.sol"; 8 | 9 | contract CloneTest is MCTest { 10 | function setUp() public { 11 | _use(Clone.clone.selector, address(new Clone())); 12 | _setDictionary(Dummy.dictionary(mc)); 13 | } 14 | 15 | function test_Clone_Success_WithoutInitData() public { 16 | vm.expectEmit(true, false, false, false, target); 17 | emit ProxyCreator.ProxyCreated(dictionary, address(0)); 18 | address cloned = Clone(target).clone(""); 19 | // forgefmt: disable-next-item 20 | assertEq( 21 | ForgeHelper.getDictionaryAddress(address(this)), 22 | ForgeHelper.getDictionaryAddress(cloned) 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/std/functions/Create.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest, console, ForgeHelper, Dummy} from "@mc-devkit/Flattened.sol"; 5 | 6 | import {Create} from "@mc-std/functions/Create.sol"; 7 | import {ProxyCreator} from "@mc-std/functions/internal/ProxyCreator.sol"; 8 | 9 | contract CreateTest is MCTest { 10 | function setUp() public { 11 | _use(Create.create.selector, address(new Create())); 12 | _setDictionary(Dummy.dictionary(mc)); 13 | } 14 | 15 | function test_Create_Success_WithoutInitData() public { 16 | vm.expectEmit(true, false, false, false, address(target)); 17 | emit ProxyCreator.ProxyCreated(dictionary, address(0)); 18 | address cloned = Create(target).create(dictionary, ""); 19 | // forgefmt: disable-next-item 20 | assertEq( 21 | ForgeHelper.getDictionaryAddress(cloned), 22 | dictionary 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/std/functions/GetFunctions.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest, console, ForgeHelper, Dummy, DummyFunction, DummyFacade} from "@mc-devkit/Flattened.sol"; 5 | 6 | import {GetFunctions} from "@mc-std/functions/GetFunctions.sol"; 7 | import {ProxyCreator} from "@mc-std/functions/internal/ProxyCreator.sol"; 8 | 9 | contract GetFunctionsTest is MCTest { 10 | function setUp() public { 11 | _use(GetFunctions.getFunctions.selector, address(new GetFunctions())); 12 | _use(DummyFunction.dummy.selector, address(new DummyFunction())); 13 | _use(DummyFunction.dummy2.selector, address(new DummyFunction())); 14 | _setDictionary(Dummy.dictionary(mc, functions)); 15 | } 16 | 17 | function test_GetFunctions_Success() public view { 18 | GetFunctions.Function[] memory funcs = GetFunctions(target).getFunctions(); 19 | for (uint256 i; i < funcs.length; ++i) { 20 | assertEq(funcs[i].selector, functions[i].selector); 21 | assertEq(funcs[i].implementation, functions[i].implementation); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/std/functions/Receive.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest} from "@mc-devkit/Flattened.sol"; 5 | import {Receive} from "@mc-std/functions/Receive.sol"; 6 | 7 | contract ReceiveTest is MCTest { 8 | function setUp() public { 9 | _use(bytes4(0), address(new Receive())); 10 | } 11 | 12 | function test_Receive_Success() public { 13 | vm.deal(address(this), 100 ether); 14 | 15 | vm.expectEmit(target); 16 | emit Receive.Received(address(this), 100 ether); 17 | (bool success,) = target.call{value: 100 ether}(""); 18 | 19 | assertTrue(success); 20 | assertEq(target.balance, 100 ether); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/std/functions/internal/ProxyCreator.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest, ForgeHelper, Dummy} from "@mc-devkit/Flattened.sol"; 5 | 6 | import {ProxyCreator} from "@mc-std/functions/internal/ProxyCreator.sol"; 7 | 8 | contract ProxyCreatorTest is MCTest { 9 | function test_create_Success() public { 10 | address dictionary = Dummy.contractAddr(); 11 | 12 | vm.expectEmit(true, false, false, false, address(this)); 13 | emit ProxyCreator.ProxyCreated(dictionary, makeAddr("Proxy")); 14 | address proxy = ProxyCreator.create(dictionary, ""); 15 | 16 | assertEq(ForgeHelper.getDictionaryAddress(proxy), dictionary); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/std/functions/protected/InitSetAdmin.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.22; 3 | 4 | import {MCTest} from "@mc-devkit/Flattened.sol"; 5 | 6 | import {InitSetAdmin} from "@mc-std/functions/protected/InitSetAdmin.sol"; 7 | import {Initialization} from "@mc-std/functions/protected/protection/Initialization.sol"; 8 | import {Storage} from "@mc-std/storage/Storage.sol"; 9 | 10 | contract InitSetAdminTest is MCTest { 11 | function setUp() public { 12 | _use(InitSetAdmin.initSetAdmin.selector, address(new InitSetAdmin())); 13 | } 14 | 15 | function test_InitSetAdmin_Success() public { 16 | address admin = makeAddr("Admin"); 17 | 18 | vm.expectEmit(target); 19 | emit InitSetAdmin.AdminSet(admin); 20 | emit Initialization.Initialized(1); 21 | InitSetAdmin(target).initSetAdmin(admin); 22 | 23 | assertEq(Storage.Admin().admin, admin); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/std/functions/protected/protection/Initialization.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | 6 | import {Initialization} from "@mc-std/functions/protected/protection/Initialization.sol"; 7 | import {Storage} from "@mc-std/storage/Storage.sol"; 8 | 9 | contract InitializationTest is Test { 10 | function test_ShouldNotBeCompleted_Success() public view { 11 | Initialization.shouldNotBeCompleted(); 12 | } 13 | 14 | function test_ShouldNotBeCompleted_RevertIf_VersionIsNotZero() public { 15 | Storage.Initialization().initialized = 1; 16 | 17 | vm.expectRevert(Initialization.InvalidInitialization.selector); 18 | Initialization.shouldNotBeCompleted(); 19 | } 20 | 21 | function test_WillBeCompleted_Success() public { 22 | vm.expectEmit(address(this)); 23 | emit Initialization.Initialized(1); 24 | Initialization.willBeCompleted(); 25 | 26 | assertEq(Storage.Initialization().initialized, 1); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/std/functions/protected/protection/MsgSender.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | 6 | import {MsgSender} from "@mc-std/functions/protected/protection/MsgSender.sol"; 7 | 8 | contract MsgSenderTest is Test { 9 | function test_ShouldBeAdmin_RevertIf_SenderIsNotAdmin() public { 10 | vm.expectRevert(MsgSender.NotAdmin.selector); 11 | MsgSender.shouldBeAdmin(); 12 | } 13 | } 14 | --------------------------------------------------------------------------------