1c0e57d984
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
69 lines
2.1 KiB
Solidity
69 lines
2.1 KiB
Solidity
// SPDX-License-Identifier: Apache-2.0
|
|
pragma solidity >=0.8.0;
|
|
|
|
// Contract that always reverts in constructor
|
|
contract ChildRevert {
|
|
constructor() {
|
|
revert("ChildRevert: revert in constructor");
|
|
}
|
|
}
|
|
|
|
contract Caller {
|
|
function normal(address _callee, uint64 _value, bytes memory _data, uint64 _gas)
|
|
external
|
|
returns (bool success, bytes memory output)
|
|
{
|
|
(success, output) = _callee.call{value: _value, gas: _gas}(_data);
|
|
}
|
|
|
|
function delegate(address _callee, bytes memory _data, uint64 _gas)
|
|
external
|
|
returns (bool success, bytes memory output)
|
|
{
|
|
(success, output) = _callee.delegatecall{gas: _gas}(_data);
|
|
}
|
|
|
|
function staticCall(
|
|
// Don't rename to `static` (it's a Rust keyword).
|
|
address _callee,
|
|
bytes memory _data,
|
|
uint64 _gas
|
|
) external view returns (bool success, bytes memory output) {
|
|
(success, output) = _callee.staticcall{gas: _gas}(_data);
|
|
}
|
|
|
|
function create(bytes memory initcode) external payable returns (address addr) {
|
|
assembly {
|
|
// CREATE with no value
|
|
addr := create(0, add(initcode, 0x20), mload(initcode))
|
|
if iszero(addr) {
|
|
// bubble failure
|
|
let returnDataSize := returndatasize()
|
|
returndatacopy(0, 0, returnDataSize)
|
|
revert(0, returnDataSize)
|
|
}
|
|
}
|
|
}
|
|
|
|
function createRevert() external returns (address addr) {
|
|
try new ChildRevert() returns (ChildRevert c) {
|
|
addr = address(c);
|
|
} catch (bytes memory reason) {
|
|
revert(string(reason));
|
|
}
|
|
}
|
|
|
|
function create2(bytes memory initcode, bytes32 salt) external payable returns (address addr) {
|
|
assembly {
|
|
// CREATE2 with no value
|
|
addr := create2(0, add(initcode, 0x20), mload(initcode), salt)
|
|
if iszero(addr) {
|
|
// bubble failure
|
|
let returnDataSize := returndatasize()
|
|
returndatacopy(0, 0, returnDataSize)
|
|
revert(0, returnDataSize)
|
|
}
|
|
}
|
|
}
|
|
}
|