@openzeppelin/upgrade-safe-transpiler
Version:
Solidity preprocessor used to generate OpenZeppelin Contracts Upgrade Safe.
116 lines (107 loc) • 4.72 kB
Markdown
The actual snapshot is saved in `prepare-peer-project.test.ts.snap`.
Generated by [AVA](https://avajs.dev).
> Snapshot 1
{
fileName: 'SomeContract.sol',
path: 'contracts/project/SomeContractUpgradeable.sol',
source: `// SPDX-License-Identifier: UNLICENSED␊
pragma solidity ^0.8.0;␊
␊
import {ISomeInterface} from "@openzeppelin/contracts/project/ISomeInterface.sol";␊
import {SomeLibrary} from "@openzeppelin/contracts/project/SomeLibrary.sol";␊
import {SomeStatelessContract} from "@openzeppelin/contracts/project/SomeStatelessContract.sol";␊
import {Initializable} from "../Initializable.sol";␊
␊
import { ISomeContract } from "@openzeppelin/contracts/project/SomeContract.sol";␊
␊
import { Error1 } from "@openzeppelin/contracts/project/SomeContract.sol";␊
␊
import { freeFn_1 } from "@openzeppelin/contracts/project/SomeContract.sol";␊
␊
import { SomeStruct } from "@openzeppelin/contracts/project/SomeContract.sol";␊
␊
contract SomeBaseContractUpgradeable is Initializable {␊
function __SomeBaseContract_init() internal onlyInitializing {␊
}␊
␊
function __SomeBaseContract_init_unchained() internal onlyInitializing {␊
}␊
function test(ISomeInterface other) public virtual returns (bool) {␊
return SomeLibrary.bothFunctions(other);␊
}␊
␊
/**␊
* @dev This empty reserved space is put in place to allow future versions to add new␊
* variables without shifting down storage in the inheritance chain.␊
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps␊
*/␊
uint256[50] private __gap;␊
}␊
␊
contract SomeContractUpgradeable is Initializable, ISomeContract, SomeBaseContractUpgradeable {␊
SomeStruct s;␊
␊
function __SomeContract_init() internal onlyInitializing {␊
}␊
␊
function __SomeContract_init_unchained() internal onlyInitializing {␊
}␊
/// @inheritdoc ISomeInterface␊
function someFunction() public pure override returns (bool) {␊
return false;␊
}␊
␊
/// @inheritdoc ISomeInterface␊
function someOtherFunction() public pure override returns (bool) {␊
return true;␊
}␊
␊
/// @inheritdoc SomeBaseContractUpgradeable␊
function test(ISomeInterface other) public override returns (bool) {␊
return SomeLibrary.bothFunctions(this) && super.test(other);␊
}␊
␊
/**␊
* @dev This empty reserved space is put in place to allow future versions to add new␊
* variables without shifting down storage in the inheritance chain.␊
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps␊
*/␊
uint256[49] private __gap;␊
}␊
`,
}
> Snapshot 1
{
fileName: 'SomeOtherContract.sol',
path: 'contracts/project/SomeOtherContractUpgradeable.sol',
source: `// SPDX-License-Identifier: UNLICENSED␊
pragma solidity ^0.8.0;␊
␊
import {ISomeInterface} from "@openzeppelin/contracts/project/ISomeInterface.sol";␊
import {SomeLibrary} from "@openzeppelin/contracts/project/SomeLibrary.sol";␊
import {ISomeContract} from "@openzeppelin/contracts/project/SomeContract.sol";␊
import {SomeContractUpgradeable} from "./SomeContractUpgradeable.sol";␊
import {Initializable} from "../Initializable.sol";␊
␊
contract SomeOtherContractUpgradeable is Initializable, SomeContractUpgradeable {␊
function __SomeOtherContract_init() internal onlyInitializing {␊
}␊
␊
function __SomeOtherContract_init_unchained() internal onlyInitializing {␊
}␊
function extraFunction() public returns (uint256) {␊
return 42;␊
}␊
␊
/**␊
* @dev This empty reserved space is put in place to allow future versions to add new␊
* variables without shifting down storage in the inheritance chain.␊
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps␊
*/␊
uint256[50] private __gap;␊
}␊
`,
}