This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cr fix - move contract codes to contractsapi
- Loading branch information
1 parent
6e075ab
commit 99efd02
Showing
14 changed files
with
351 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
consensus/polybft/contractsapi/test-contracts/ITestBenchmarkB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "ITestBenchmarkB", | ||
"sourceName": "contracts/test/TestBenchmarkA.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "fnB", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x", | ||
"deployedBytecode": "0x", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
24 changes: 24 additions & 0 deletions
24
consensus/polybft/contractsapi/test-contracts/ITestBenchmarkC.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "ITestBenchmarkC", | ||
"sourceName": "contracts/test/TestBenchmarkB.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "fnC1", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x", | ||
"deployedBytecode": "0x", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
37 changes: 37 additions & 0 deletions
37
consensus/polybft/contractsapi/test-contracts/TestBenchmarkA.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "TestBenchmarkA", | ||
"sourceName": "contracts/test/TestBenchmarkA.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "fnA", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_contract", | ||
"type": "address" | ||
} | ||
], | ||
"name": "setContractAddr", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x608060405234801561001057600080fd5b5061017b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063286d2e3a1461003b57806368685ad31461006d575b600080fd5b61006b6100493660046100fc565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b005b610075610087565b60405190815260200160405180910390f35b6000805460408051636cde00cd60e01b8152905183926001600160a01b031691636cde00cd916004808301926020929190829003018187875af11580156100d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f6919061012c565b92915050565b60006020828403121561010e57600080fd5b81356001600160a01b038116811461012557600080fd5b9392505050565b60006020828403121561013e57600080fd5b505191905056fea2646970667358221220a8ce85649b9a1ab453ecb852ac36c64f7be380547a5cf2faf83ffdbb59b6424464736f6c63430008130033", | ||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063286d2e3a1461003b57806368685ad31461006d575b600080fd5b61006b6100493660046100fc565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b005b610075610087565b60405190815260200160405180910390f35b6000805460408051636cde00cd60e01b8152905183926001600160a01b031691636cde00cd916004808301926020929190829003018187875af11580156100d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f6919061012c565b92915050565b60006020828403121561010e57600080fd5b81356001600160a01b038116811461012557600080fd5b9392505050565b60006020828403121561013e57600080fd5b505191905056fea2646970667358221220a8ce85649b9a1ab453ecb852ac36c64f7be380547a5cf2faf83ffdbb59b6424464736f6c63430008130033", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
18 changes: 18 additions & 0 deletions
18
consensus/polybft/contractsapi/test-contracts/TestBenchmarkA.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
interface ITestBenchmarkB { | ||
function fnB() external returns (uint256); | ||
} | ||
contract TestBenchmarkA { | ||
address contractAddr; | ||
|
||
function setContractAddr(address _contract) public { | ||
contractAddr = _contract; | ||
} | ||
|
||
function fnA() public returns (uint256) { | ||
uint256 valB = ITestBenchmarkB(contractAddr).fnB(); | ||
return valB; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
consensus/polybft/contractsapi/test-contracts/TestBenchmarkB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "TestBenchmarkB", | ||
"sourceName": "contracts/test/TestBenchmarkB.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "fnB", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_contract", | ||
"type": "address" | ||
} | ||
], | ||
"name": "setContractAddr", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "valB", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x608060405234801561001057600080fd5b506101db806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063286d2e3a146100465780636cde00cd14610078578063735b7e6f14610092575b600080fd5b610076610054366004610135565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b005b61008061009b565b60405190815260200160405180910390f35b61008060005481565b600080600160009054906101000a90046001600160a01b03166001600160a01b03166349ec07186040518163ffffffff1660e01b81526004016020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610165565b90508060008082825461012a919061017e565b909155509092915050565b60006020828403121561014757600080fd5b81356001600160a01b038116811461015e57600080fd5b9392505050565b60006020828403121561017757600080fd5b5051919050565b8082018082111561019f57634e487b7160e01b600052601160045260246000fd5b9291505056fea26469706673582212209f01d2971a8238a2a1c208a8dde49ecc84579475e54782314375cb36d1bf60ea64736f6c63430008130033", | ||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063286d2e3a146100465780636cde00cd14610078578063735b7e6f14610092575b600080fd5b610076610054366004610135565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b005b61008061009b565b60405190815260200160405180910390f35b61008060005481565b600080600160009054906101000a90046001600160a01b03166001600160a01b03166349ec07186040518163ffffffff1660e01b81526004016020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610165565b90508060008082825461012a919061017e565b909155509092915050565b60006020828403121561014757600080fd5b81356001600160a01b038116811461015e57600080fd5b9392505050565b60006020828403121561017757600080fd5b5051919050565b8082018082111561019f57634e487b7160e01b600052601160045260246000fd5b9291505056fea26469706673582212209f01d2971a8238a2a1c208a8dde49ecc84579475e54782314375cb36d1bf60ea64736f6c63430008130033", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
20 changes: 20 additions & 0 deletions
20
consensus/polybft/contractsapi/test-contracts/TestBenchmarkB.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
interface ITestBenchmarkC { | ||
function fnC1() external returns (uint256); | ||
} | ||
contract TestBenchmarkB { | ||
uint256 public valB; | ||
address contractAddr; | ||
|
||
function setContractAddr(address _contract) public { | ||
contractAddr = _contract; | ||
} | ||
|
||
function fnB() external returns (uint256) { | ||
uint256 valC = ITestBenchmarkC(contractAddr).fnC1(); | ||
valB += valC; | ||
return valC; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
consensus/polybft/contractsapi/test-contracts/TestBenchmarkC.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "TestBenchmarkC", | ||
"sourceName": "contracts/test/TestBenchmarkC.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "fnC1", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "fnC2", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "valC", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x608060405234801561001057600080fd5b5061015f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631990ceb9146100465780633b3cf4e31461006057806349ec071814610069575b600080fd5b61004e610071565b60405190815260200160405180910390f35b61004e60005481565b61004e6100b9565b600060644244604051602001610091929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c6100b491906100e0565b905090565b6000806100c4610071565b60008054919250806100d583610102565b909155509092915050565b6000826100fd57634e487b7160e01b600052601260045260246000fd5b500690565b60006001820161012257634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122092ffbbf005793faaa839fdfd4e894697301342a305e3e8734927815308198d7964736f6c63430008130033", | ||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80631990ceb9146100465780633b3cf4e31461006057806349ec071814610069575b600080fd5b61004e610071565b60405190815260200160405180910390f35b61004e60005481565b61004e6100b9565b600060644244604051602001610091929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c6100b491906100e0565b905090565b6000806100c4610071565b60008054919250806100d583610102565b909155509092915050565b6000826100fd57634e487b7160e01b600052601260045260246000fd5b500690565b60006001820161012257634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122092ffbbf005793faaa839fdfd4e894697301342a305e3e8734927815308198d7964736f6c63430008130033", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
Oops, something went wrong.