mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-05-21 08:29:32 +00:00
Rename Codex to Logos Storage (#262)
This commit is contained in:
parent
da1400ce9a
commit
e159ceee44
2
.github/workflows/docker-dist-tests.yml
vendored
2
.github/workflows/docker-dist-tests.yml
vendored
@ -20,7 +20,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
name: Build and Push
|
name: Build and Push
|
||||||
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
uses: logos-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
||||||
with:
|
with:
|
||||||
docker_file: docker/deploy.Dockerfile
|
docker_file: docker/deploy.Dockerfile
|
||||||
dockerhub_repo: codexstorage/codex-contracts-eth
|
dockerhub_repo: codexstorage/codex-contracts-eth
|
||||||
|
|||||||
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@ -20,7 +20,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
name: Build and Push
|
name: Build and Push
|
||||||
uses: codex-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
uses: logos-storage/github-actions/.github/workflows/docker-reusable.yml@master
|
||||||
with:
|
with:
|
||||||
docker_file: docker/Dockerfile
|
docker_file: docker/Dockerfile
|
||||||
dockerhub_repo: codexstorage/codex-contracts-eth
|
dockerhub_repo: codexstorage/codex-contracts-eth
|
||||||
|
|||||||
10
Readme.md
10
Readme.md
@ -1,7 +1,7 @@
|
|||||||
Codex Contracts
|
Logos Storage Contracts
|
||||||
================
|
================
|
||||||
|
|
||||||
An experimental implementation of the smart contracts that underlay the Codex
|
An experimental implementation of the smart contracts that underlay the Logos Storage
|
||||||
storage network. Its goal is to experiment with the rules around the bidding
|
storage network. Its goal is to experiment with the rules around the bidding
|
||||||
process, the storage contracts, the storage proofs and the host collateral.
|
process, the storage contracts, the storage proofs and the host collateral.
|
||||||
Neither completeness nor correctness are guaranteed at this moment in time.
|
Neither completeness nor correctness are guaranteed at this moment in time.
|
||||||
@ -64,7 +64,7 @@ You can run Certora's specs with the provided `npm` script:
|
|||||||
Overview
|
Overview
|
||||||
--------
|
--------
|
||||||
|
|
||||||
The Codex storage network depends on hosts offering storage to clients of the
|
The Logos Storage storage network depends on hosts offering storage to clients of the
|
||||||
network. The smart contracts in this repository handle interactions between
|
network. The smart contracts in this repository handle interactions between
|
||||||
client and hosts as they negotiate and fulfill a contract to store data for a
|
client and hosts as they negotiate and fulfill a contract to store data for a
|
||||||
certain amount of time.
|
certain amount of time.
|
||||||
@ -146,10 +146,10 @@ References
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
* [A marketplace for storage
|
* [A marketplace for storage
|
||||||
durability](https://github.com/codex-storage/codex-research/blob/master/design/marketplace.md)
|
durability](https://github.com/logos-storage/logos-storage-research/blob/master/design/marketplace.md)
|
||||||
(design document)
|
(design document)
|
||||||
* [Timing of Storage
|
* [Timing of Storage
|
||||||
Proofs](https://github.com/codex-storage/codex-research/blob/master/design/storage-proof-timing.md)
|
Proofs](https://github.com/logos-storage/logos-storage-research/blob/master/design/storage-proof-timing.md)
|
||||||
(design document)
|
(design document)
|
||||||
|
|
||||||
To Do
|
To Do
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Copyright 2017 Christian Reitwiessner
|
// Copyright 2017 Christian Reitwiessner
|
||||||
// Copyright 2019 OKIMS
|
// Copyright 2019 OKIMS
|
||||||
// Copyright 2024 Codex
|
// Copyright 2025 Logos Storage
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
// in the Software without restriction, including without limitation the rights
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
|||||||
@ -80,7 +80,7 @@ abstract contract Proofs is Periods {
|
|||||||
* @param id Slot's ID for which the pointer should be calculated
|
* @param id Slot's ID for which the pointer should be calculated
|
||||||
* @param period Period for which the pointer should be calculated
|
* @param period Period for which the pointer should be calculated
|
||||||
* @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.
|
* @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.
|
||||||
* @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)
|
* @dev For more information see [timing of storage proofs](https://github.com/logos-storage/logos-storage-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)
|
||||||
*/
|
*/
|
||||||
function _getPointer(SlotId id, Period period) internal view returns (uint8) {
|
function _getPointer(SlotId id, Period period) internal view returns (uint8) {
|
||||||
uint256 blockNumber = block.number % 256;
|
uint256 blockNumber = block.number % 256;
|
||||||
@ -94,7 +94,7 @@ abstract contract Proofs is Periods {
|
|||||||
/**
|
/**
|
||||||
* @param id Slot's ID for which the pointer should be calculated
|
* @param id Slot's ID for which the pointer should be calculated
|
||||||
* @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.
|
* @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.
|
||||||
* @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)
|
* @dev For more information see [timing of storage proofs](https://github.com/logos-storage/logos-storage-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)
|
||||||
*/
|
*/
|
||||||
function getPointer(SlotId id) public view returns (uint8) {
|
function getPointer(SlotId id) public view returns (uint8) {
|
||||||
return _getPointer(id, _blockPeriod());
|
return _getPointer(id, _blockPeriod());
|
||||||
@ -147,7 +147,7 @@ abstract contract Proofs is Periods {
|
|||||||
bytes32 challenge = _getChallenge(pointer);
|
bytes32 challenge = _getChallenge(pointer);
|
||||||
|
|
||||||
/// Scaling of the probability according the downtime configuration
|
/// Scaling of the probability according the downtime configuration
|
||||||
/// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime
|
/// See: https://github.com/logos-storage/logos-storage-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime
|
||||||
uint256 probability = slotProbability(id);
|
uint256 probability = slotProbability(id);
|
||||||
isRequired = probability == 0 || uint256(challenge) % probability == 0;
|
isRequired = probability == 0 || uint256(challenge) % probability == 0;
|
||||||
}
|
}
|
||||||
@ -179,7 +179,7 @@ abstract contract Proofs is Periods {
|
|||||||
* in downtime (hence no proof required now) and at the same time the proof
|
* in downtime (hence no proof required now) and at the same time the proof
|
||||||
* will be required later on in the Period.
|
* will be required later on in the Period.
|
||||||
*
|
*
|
||||||
* @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)
|
* @dev for more info about downtime see [timing of storage proofs](https://github.com/logos-storage/logos-storage-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)
|
||||||
* @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.
|
* @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -24,10 +24,10 @@ Then we can run:
|
|||||||
npx hardhat ignition deploy ignition/modules/migration/token.js --network taiko_test
|
npx hardhat ignition deploy ignition/modules/migration/token.js --network taiko_test
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** Check [this comment](https://github.com/codex-storage/codex-contracts-eth/pull/231#issuecomment-2808996517) for more context.
|
**Note:** Check [this comment](https://github.com/logos-storage/logos-storage-contracts-eth/pull/231#issuecomment-2808996517) for more context.
|
||||||
|
|
||||||
Here is the list of previous commits containing the ABI contracts that were deployed:
|
Here is the list of previous commits containing the ABI contracts that were deployed:
|
||||||
|
|
||||||
- [Taiko](https://github.com/codex-storage/codex-contracts-eth/commit/1854dfba9991a25532de5f6a53cf50e66afb3c8b)
|
- [Taiko](https://github.com/logos-storage/logos-storage-contracts-eth/commit/1854dfba9991a25532de5f6a53cf50e66afb3c8b)
|
||||||
- [Testnet](https://github.com/codex-storage/codex-contracts-eth/commit/449d64ffc0dc1478d0690d36f037358084a17b09)
|
- [Testnet](https://github.com/logos-storage/logos-storage-contracts-eth/commit/449d64ffc0dc1478d0690d36f037358084a17b09)
|
||||||
- [Linea](https://github.com/codex-storage/codex-contracts-eth/pull/226/commits/2dddc260152b6e9c24ae372397f9b9b2d27ce8e4)
|
- [Linea](https://github.com/logos-storage/logos-storage-contracts-eth/pull/226/commits/2dddc260152b6e9c24ae372397f9b9b2d27ce8e4)
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "codex-contracts-eth",
|
"name": "logos-storage-contracts-eth",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "codex-contracts-eth",
|
"name": "logos-storage-contracts-eth",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
|
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "codex-contracts-eth",
|
"name": "logos-storage-contracts-eth",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && hardhat test",
|
"test": "npm run lint && hardhat test",
|
||||||
|
|||||||
@ -24,7 +24,7 @@ const MarketplaceModule = require("../ignition/modules/marketplace")
|
|||||||
// more than a certain percentage.
|
// more than a certain percentage.
|
||||||
// The percentages from these tests should be used to pad the gas estimates in
|
// The percentages from these tests should be used to pad the gas estimates in
|
||||||
// market.nim, for example when calling fillSlot:
|
// market.nim, for example when calling fillSlot:
|
||||||
// https://github.com/codex-storage/nim-codex/blob/6db6bf5f72a0038b77d02f48dcf128b4d77b469a/codex/contracts/market.nim#L278
|
// https://github.com/logos-storage/logos-storage-nim/blob/6db6bf5f72a0038b77d02f48dcf128b4d77b469a/codex/contracts/market.nim#L278
|
||||||
describe("Marketplace gas estimates", function () {
|
describe("Marketplace gas estimates", function () {
|
||||||
let marketplace
|
let marketplace
|
||||||
let token
|
let token
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user