Skip to content

Commit

Permalink
Safe Cast adding tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Stefanov <[email protected]>
  • Loading branch information
stefan-stefanooov committed Nov 23, 2023
1 parent 5978775 commit 91856b8
Show file tree
Hide file tree
Showing 15 changed files with 2,214 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../../build-info/dec15a2c1d17d204bdfcc03ceac1e4ca.json"
"buildInfo": "../../../../../build-info/3f95829b0790d58068477b0d5ee56231.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../../build-info/3f95829b0790d58068477b0d5ee56231.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "ReentrancyGuardTestReceiver",
"sourceName": "contracts/solidity/oz/ReentrancyGuard/ReentrancyGuardTestReceiver.sol",
"abi": [
{
"inputs": [
{
"internalType": "address payable",
"name": "_reentrancyGuardTestSender",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "attack",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "attackNonReentrant",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "reentrancyGuardTestSender",
"outputs": [
{
"internalType": "contract ReentrancyGuardTestSender",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_nonReentrant",
"type": "bool"
}
],
"name": "setNonReentrant",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"bytecode": "0x60806040526000805460ff60a01b1916905534801561001d57600080fd5b5060405161033b38038061033b83398101604081905261003c91610061565b600080546001600160a01b0319166001600160a01b0392909216919091179055610091565b60006020828403121561007357600080fd5b81516001600160a01b038116811461008a57600080fd5b9392505050565b61029b806100a06000396000f3fe6080604052600436106100435760003560e01c80635705d8e61461011b57806393abfaf1146101575780639e5faafc14610190578063f68d7e581461019857600080fd5b36610116576305f5e1003331108015906100675750600054600160a01b900460ff16155b156100c357600080546040805163dd09946160e01b815290516001600160a01b039092169263dd0994619260048084019382900301818387803b1580156100ad57600080fd5b505af11580156100c1573d6000803e3d6000fd5b005b600054600160a01b900460ff16156100c157600080546040805163c9b0b3b360e01b815290516001600160a01b039092169263c9b0b3b39260048084019382900301818387803b1580156100ad57600080fd5b600080fd5b34801561012757600080fd5b5060005461013b906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561016357600080fd5b506100c161017236600461023c565b60008054911515600160a01b0260ff60a01b19909216919091179055565b6100c16101a0565b6100c16101fb565b600080546040805163dd09946160e01b815290516001600160a01b039092169263dd0994619260048084019382900301818387803b1580156101e157600080fd5b505af11580156101f5573d6000803e3d6000fd5b50505050565b600080546040805163c9b0b3b360e01b815290516001600160a01b039092169263c9b0b3b39260048084019382900301818387803b1580156101e157600080fd5b60006020828403121561024e57600080fd5b8135801515811461025e57600080fd5b939250505056fea2646970667358221220faf10d863d0f527ff108056170529a193de36942820d44659df97130c7ecfb5a64736f6c63430008140033",
"deployedBytecode": "0x6080604052600436106100435760003560e01c80635705d8e61461011b57806393abfaf1146101575780639e5faafc14610190578063f68d7e581461019857600080fd5b36610116576305f5e1003331108015906100675750600054600160a01b900460ff16155b156100c357600080546040805163dd09946160e01b815290516001600160a01b039092169263dd0994619260048084019382900301818387803b1580156100ad57600080fd5b505af11580156100c1573d6000803e3d6000fd5b005b600054600160a01b900460ff16156100c157600080546040805163c9b0b3b360e01b815290516001600160a01b039092169263c9b0b3b39260048084019382900301818387803b1580156100ad57600080fd5b600080fd5b34801561012757600080fd5b5060005461013b906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561016357600080fd5b506100c161017236600461023c565b60008054911515600160a01b0260ff60a01b19909216919091179055565b6100c16101a0565b6100c16101fb565b600080546040805163dd09946160e01b815290516001600160a01b039092169263dd0994619260048084019382900301818387803b1580156101e157600080fd5b505af11580156101f5573d6000803e3d6000fd5b50505050565b600080546040805163c9b0b3b360e01b815290516001600160a01b039092169263c9b0b3b39260048084019382900301818387803b1580156101e157600080fd5b60006020828403121561024e57600080fd5b8135801515811461025e57600080fd5b939250505056fea2646970667358221220faf10d863d0f527ff108056170529a193de36942820d44659df97130c7ecfb5a64736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../../build-info/3f95829b0790d58068477b0d5ee56231.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "ReentrancyGuardTestSender",
"sourceName": "contracts/solidity/oz/ReentrancyGuard/ReentrancyGuardTestSender.sol",
"abi": [
{
"inputs": [],
"stateMutability": "payable",
"type": "constructor"
},
{
"inputs": [],
"name": "ReentrancyGuardReentrantCall",
"type": "error"
},
{
"inputs": [],
"name": "counter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "reentrancyTest",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "reentrancyTestNonReentrant",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"bytecode": "0x60806040526000600181815590556101f48061001c6000396000f3fe6080604052600436106100385760003560e01c806361bc221a14610044578063c9b0b3b31461006c578063dd0994611461008357600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b5061005a60015481565b60405190815260200160405180910390f35b34801561007857600080fd5b50610081610098565b005b34801561008f57600080fd5b5061008161010c565b6100a061016d565b600180546100ad91610197565b60015560405160009033906305f5e100908381818185875af1925050503d80600081146100f6576040519150601f19603f3d011682016040523d82523d6000602084013e6100fb565b606091505b505090505061010a6001600055565b565b6001805461011991610197565b60015560405160009033906305f5e100908381818185875af1925050503d8060008114610162576040519150601f19603f3d011682016040523d82523d6000602084013e610167565b606091505b50505050565b60026000540361019057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b808201808211156101b857634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220b40a31d03c7261a01b90674539db8114c28eed7f51d2f6b559e2d37e861fc3ac64736f6c63430008140033",
"deployedBytecode": "0x6080604052600436106100385760003560e01c806361bc221a14610044578063c9b0b3b31461006c578063dd0994611461008357600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b5061005a60015481565b60405190815260200160405180910390f35b34801561007857600080fd5b50610081610098565b005b34801561008f57600080fd5b5061008161010c565b6100a061016d565b600180546100ad91610197565b60015560405160009033906305f5e100908381818185875af1925050503d80600081146100f6576040519150601f19603f3d011682016040523d82523d6000602084013e6100fb565b606091505b505090505061010a6001600055565b565b6001805461011991610197565b60015560405160009033906305f5e100908381818185875af1925050503d8060008114610162576040519150601f19603f3d011682016040523d82523d6000602084013e610167565b606091505b50505050565b60026000540361019057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b808201808211156101b857634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220b40a31d03c7261a01b90674539db8114c28eed7f51d2f6b559e2d37e861fc3ac64736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../../build-info/3f95829b0790d58068477b0d5ee56231.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "ContractCreatorOZCreate2",
"sourceName": "contracts/solidity/oz/create2/ContractCreatorOZCreate2.sol",
"abi": [
{
"inputs": [],
"stateMutability": "payable",
"type": "constructor"
},
{
"inputs": [],
"name": "Create2EmptyBytecode",
"type": "error"
},
{
"inputs": [],
"name": "Create2FailedDeployment",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "needed",
"type": "uint256"
}
],
"name": "Create2InsufficientBalance",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"name": "NewContractDeployedAt",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "salt",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "bytecodeHash",
"type": "bytes32"
}
],
"name": "computeAddress",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "salt",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
}
],
"name": "deploy",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x60806040526102d1806100136000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806366b24bdf1461003b578063b2255ea21461006a575b600080fd5b61004e61004936600461019f565b61007f565b6040516001600160a01b03909116815260200160405180910390f35b61007d6100783660046101d7565b610092565b005b600061008b83836100e4565b9392505050565b600061009f8484846100f1565b6040516001600160a01b03821681529091507f4622a5a13cef67b7d240d8e6e0599fc0b5ef7893aa06e147dc08a9da69946b769060200160405180910390a150505050565b600061008b838330610175565b6000834710156101215760405163392efb2b60e21b81524760048201526024810185905260440160405180910390fd5b815160000361014357604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008b57604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101b257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156101ec57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561021257600080fd5b818601915086601f83011261022657600080fd5b813581811115610238576102386101c1565b604051601f8201601f19908116603f01168101908382118183101715610260576102606101c1565b8160405282815289602084870101111561027957600080fd5b826020860160208301376000602084830101528095505050505050925092509256fea2646970667358221220f6b7ae42442fdeeb4ff679f5b709717ccbbca103570ccf604ec3457723216b5964736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806366b24bdf1461003b578063b2255ea21461006a575b600080fd5b61004e61004936600461019f565b61007f565b6040516001600160a01b03909116815260200160405180910390f35b61007d6100783660046101d7565b610092565b005b600061008b83836100e4565b9392505050565b600061009f8484846100f1565b6040516001600160a01b03821681529091507f4622a5a13cef67b7d240d8e6e0599fc0b5ef7893aa06e147dc08a9da69946b769060200160405180910390a150505050565b600061008b838330610175565b6000834710156101215760405163392efb2b60e21b81524760048201526024810185905260440160405180910390fd5b815160000361014357604051631328927760e21b815260040160405180910390fd5b8282516020840186f590506001600160a01b03811661008b57604051633a0ba96160e11b815260040160405180910390fd5b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080604083850312156101b257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156101ec57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561021257600080fd5b818601915086601f83011261022657600080fd5b813581811115610238576102386101c1565b604051601f8201601f19908116603f01168101908382118183101715610260576102606101c1565b8160405282815289602084870101111561027957600080fd5b826020860160208301376000602084830101528095505050505050925092509256fea2646970667358221220f6b7ae42442fdeeb4ff679f5b709717ccbbca103570ccf604ec3457723216b5964736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../../build-info/3f95829b0790d58068477b0d5ee56231.json"
}
Loading

0 comments on commit 91856b8

Please sign in to comment.