I wonder is there some possibility to listen MakerDAO's LogNote events, like we able to do with standard events.
What I managed to research:
I saw that LogNote was listed as an event from contract details
let contractIntanse = await new web3.eth.Contract(abi, contractAddress); console.log("contractIntanse.events: ", contractIntanse.events) contractIntanse.events: { Approval: [Function: bound ], '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925': [Function: bound ], 'Approval(address,address,uint256)': [Function: bound ], LogNote: [Function: bound ], '0xd3d8bec38a91a5f4411247483bc030a174e77cda9c0351924c759f41453aa5e8': [Function: bound ], 'LogNote(bytes4,address,bytes32,bytes32,bytes)': [Function: bound ], Transfer: [Function: bound ], '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef': [Function: bound ], 'Transfer(address,address,uint256)': [Function: bound ], allEvents: [Function: bound ] } However, I was not able to check this properly, e.g:
1. event.watch does not work for me because of web3 v1
2. I tried using WebsocketProvider
web3.eth.subscribe("logs", { address: "0x23..." }, function(error, result) { console.log("subscribe result:",result); console.log("subscribe error:",error); }) .on("connected", function(subscriptionId) { console.log("subscriptionId:" + subscriptionId); }) .on("data", function(log) { console.log("data:" + log); }) .on("changed", function(log) { console.log("changed:" + log); }); However, I was not able to see smth when I trigger event
await contractIntanse.methods.rely(address1); Here is related issue I managed to find https://github.com/ethereum/web3.js/issues/1752
3. I also tried to use getPastEvents, as latest issues/1752 suggested
const eventOptions = { filter: {}, fromBlock: 0, toBlock: 'latest' }; const events = await contractIntanse.getPastEvents('LogNote', eventOptions); It works ok for standartd event. However, for LogNote I get an error:
Error: overflow (operation="setValue", fault="overflow", details="Number can only safely store up to 53 bits") Eventually, I'm very confused, do we able to listen MakerDAO's LogNote? Appreciate any help, link to docs, discussions etc. Thanks!
ADDITIONAL:
I'm using DAI contract https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#contracts
Here is a commit was used for deployments on mainnet. I used as a base. https://github.com/makerdao/dss/blob/6fa55812a5fcfcfa325ad4d9a4d0ca4033c38cab/src/dai.sol
The LogNote takes from LibNote. It what I'm trying to listen. https://github.com/makerdao/dss/blob/6fa55812a5fcfcfa325ad4d9a4d0ca4033c38cab/src/lib.sol