Document not found (404)
-This URL is invalid, sorry. Please use the navigation bar or search to continue.
- -diff --git a/audits/2022_03_quantstamp.pdf b/audits/2022_03_quantstamp.pdf new file mode 100644 index 00000000..5746bc75 Binary files /dev/null and b/audits/2022_03_quantstamp.pdf differ diff --git a/audits/2023_07_solidified.pdf b/audits/2023_07_solidified.pdf new file mode 100644 index 00000000..35634cbf Binary files /dev/null and b/audits/2023_07_solidified.pdf differ diff --git a/audits/2024_01_solidified.pdf b/audits/2024_01_solidified.pdf new file mode 100644 index 00000000..b54d7d39 Binary files /dev/null and b/audits/2024_01_solidified.pdf differ diff --git a/audits/2024_03_solidified.pdf b/audits/2024_03_solidified.pdf new file mode 100644 index 00000000..049fa0b7 Binary files /dev/null and b/audits/2024_03_solidified.pdf differ diff --git a/whitepaper/Kresko Synthetic Asset Protocol v1_2023-01-23.pdf b/docs/2023_01_whitepaper.pdf similarity index 100% rename from whitepaper/Kresko Synthetic Asset Protocol v1_2023-01-23.pdf rename to docs/2023_01_whitepaper.pdf diff --git a/docs/2024_03_litepaper_pre.pdf b/docs/2024_03_litepaper_pre.pdf new file mode 100644 index 00000000..8646b583 Binary files /dev/null and b/docs/2024_03_litepaper_pre.pdf differ diff --git a/docs/book/.nojekyll b/docs/book/.nojekyll deleted file mode 100644 index f1731109..00000000 --- a/docs/book/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -This file makes sure that Github Pages doesn't process mdBook's output. diff --git a/docs/book/404.html b/docs/book/404.html deleted file mode 100644 index 878d940f..00000000 --- a/docs/book/404.html +++ /dev/null @@ -1,221 +0,0 @@ - - -
- - -This URL is invalid, sorry. Please use the navigation bar or search to continue.
- -This repository contains the code for the Kresko Protocol. Kresko Protocol supports creating and managing crypto-backed synthetic assets. Prices for synthetic assets are derived from combination of oracle providers (on-demand/push). Protocol uses the EIP-2535 architecture. It enables composability through flexibile storage patterns while allowing users to access all core functionality with a single contract address. This is a usage and integration guide that assumes familiarity with Solidity (and EIP-2535), Foundry, Hardhat and core concepts of Kresko.
- -(OPTIONAL) create .env file cp .env.example .env
Install forge dependencies
-forge install
-
-Install node dependencies
-(Authorized npm token is required in .npmrc for some internal packages. This will be lifted later.)
pnpm i
-
-Compile the contracts using foundry
-forge build
-
-Check your setup by running the local forge deployment
-forge script src/contracts/scripts/devnet/Devnet.s.sol:WithLocal
-
-Compile the contracts using hardhat
-pnpm compile
-
-Check your setup by running the local hardhat deployment
-pnpm run deploy --tags local
-
-NOTE: Primary test coverage uses hardhat. Forge tests are a work in progress.
-Run tests with against a local deployment fixture:
-pnpm test
-
-forge test --ffi
-
-To local network:
-pnpm local
-
-To live network:
-pnpm deploy --network <network>
-
-Local
-forge script src/contracts/scripts/devnet/Devnet.s.sol:WithLocal
-
-process.env.FORKING
maps to network key and it's setup within hardhat-configs/networks
process.env.FORKING_BLOCKNUMBER
Run deploy in fork
-pnpm fork:deploy
-
-Run tests with --grep Forking
pnpm fork:test
-
-All external functions are contained in the facets, hardhat-diamond-abi
will combine their ABI to a separate artifact (Kresko.json) after compile.
Core logic is mostly defined inside library functions. These internal functions are attached to the minter storage struct for ease of use.
-Storage is used through a inline assembly pointer inside free function. To access the storage (+ attached internal lib functions) simply call the free function anywhere within the diamond.
-Note that Staking, AMM and KreskoAsset contracts do not live inside the diamond scope.
-Do not add new state variables to the beginning or middle of structs. Doing this makes the new state variable overwrite existing state variable data and all state variables after the new state variable reference the wrong storage location.
-Do not put structs directly in structs unless you don’t plan on ever adding more state variables to the inner structs. You won't be able to add new state variables to inner structs in upgrades. This makes sense because a struct uses a fixed number of storage locations. Adding a new state variable to an inner struct would cause the next state variable after the inner struct to be overwritten. Structs that are in mappings can be extended in upgrades, because those structs are stored in random locations based on keccak256 hashing.
-Do not add new state variables to structs that are used in arrays.
-Do not use the same namespace string for different structs. This is obvious. Two different structs at the same location will overwrite each other.
-To add new state variables to DiamondStorage pattern in eg. MinterStorage (ms), add them to the end of the struct. This makes sense because it is not possible for existing facets to overwrite state variables at new storage locations.
-New state variables can be added to the ends of structs that are used in mappings.
-The names of state variables can be changed, but that might be confusing if different facets are using different names for the same storage locations.
-Learning references
-https://eip2535diamonds.substack.com/p/compliance-with-eip-2535-diamonds
-https://github.com/solidstate-network/solidstate-solidity
-https://eip2535diamonds.substack.com/p/how-eip2535-diamonds-reduces-gas
-Contributions to Kresko Protocol are encouraged, feel free to open an issue or pull request.
All contributions are licensed under BUSL1.1.
Critical bug disclosures and inquiries should be directed to: