feat: initialize Kurdistan SDK - independent fork of Polkadot SDK

This commit is contained in:
2025-12-13 15:44:15 +03:00
commit e4778b4576
6838 changed files with 1847450 additions and 0 deletions
@@ -0,0 +1,65 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
address constant STORAGE_ADDR = 0x0000000000000000000000000000000000000901;
interface IStorage {
/// Clear the value at the given key in the contract storage.
///
/// # Important
///
/// This function can only be called via a delegate call! For Solidity, the low level
/// `delegatecall` function has to be used. For languages that use the FFI
/// of `pallet-revive`, the [`crate::HostFn::delegate_call`] function can be used.
///
/// # Parameters
///
/// - `key`: The storage key.
///
/// # Return
///
/// If no entry existed for this key, `containedKey` is `false` and
/// `valueLen` is `0`.
function clearStorage(uint32 flags, bool isFixedKey, bytes memory key)
external returns (bool containedKey, uint valueLen);
/// Checks whether there is a value stored under the given key.
///
/// The key length must not exceed the maximum defined by the contracts module parameter.
///
/// # Important
///
/// This function can only be called via a delegate call! For Solidity, the low level
/// `delegatecall` function has to be used. For languages that use the FFI
/// of `pallet-revive`, the [`crate::HostFn::delegate_call`] function can be used.
///
/// # Parameters
///
/// - `key`: The storage key.
///
/// # Return
///
/// Returns the size of the pre-existing value at the specified key.
/// If no entry exists for this key `containedKey` is `false` and
/// `valueLen` is `0`.
function containsStorage(uint32 flags, bool isFixedKey, bytes memory key)
external view returns (bool containedKey, uint valueLen);
/// Retrieve and remove the value under the given key from storage.
///
/// # Important
///
/// This function can only be called via a delegate call! For Solidity, the low level
/// `delegatecall` function has to be used. For languages that use the FFI
/// of `pallet-revive`, the [`crate::HostFn::delegate_call`] function can be used.
///
/// # Parameters
///
/// - `key`: The storage key.
///
/// # Errors
///
/// Returns empty bytes if no value was found under `key`.
function takeStorage(uint32 flags, bool isFixedKey, bytes memory key)
external returns (bytes memory);
}
@@ -0,0 +1,54 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
address constant SYSTEM_ADDR = 0x0000000000000000000000000000000000000900;
interface ISystem {
/// Computes the BLAKE2 256-bit hash on the given input.
function hashBlake256(bytes memory input) external pure returns (bytes32 digest);
/// Computes the BLAKE2 128-bit hash on the given input.
function hashBlake128(bytes memory input) external pure returns (bytes32 digest);
/// Retrieve the account id for a specified `H160` address.
///
/// Calling this function on a native `H160` chain (`type AccountId = H160`)
/// does not make sense, as it would just return the `address` that it was
/// called with.
///
/// # Note
///
/// If no mapping exists for `addr`, the fallback account id will be returned.
function toAccountId(address input) external view returns (bytes memory account_id);
/// Checks whether the caller of the contract calling this function is the origin
/// of the whole call stack.
function callerIsOrigin() external view returns (bool);
/// Checks whether the caller of the contract calling this function is root.
///
/// Note that only the origin of the call stack can be root. Hence this
/// function returning `true` implies that the contract is being called by the origin.
///
/// A return value of `true` indicates that this contract is being called by a root origin,
/// and `false` indicates that the caller is a signed origin.
function callerIsRoot() external view returns (bool);
/// Returns the minimum balance that is required for creating an account
/// (the existential deposit).
function minimumBalance() external view returns (uint);
/// Returns the code hash of the caller.
function ownCodeHash() external view returns (bytes32);
/// Returns the amount of `Weight` left.
function weightLeft() external view returns (uint64 refTime, uint64 proofSize);
/// Terminate the calling contract of this function and send balance to `beneficiary`.
/// This will revert if:
/// - called from constructor
/// - called from static context
/// - called from delegate context
/// - the contract introduced balance locks
function terminate(address beneficiary) external;
}