Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract A {
- function test1() public view returns(bool) {
- return false;
- }
- }
- contract B {
- function testCall(address addr, data) public view returns(bool) {
- return addr.call.value(0)(data);
- }
- }
- const a = await A.new()
- const b = await B.new()
- const aWeb3 = web3.eth.contract(a.abi)
- const aInstance = aWeb3.at(a.address)
- const testData = aInstance.test1.getData()
- const ans = await bInstance.testCall(aInstance.address, testData)
- console.log(ans)
- assembly{
- let success := call(10000, addr, 0, add(data, 0x20), mload(data), 0, 0x20)
- res := mload(0)
- }
- return res
Add Comment
Please, Sign In to add comment