diff --git a/CI/exploits/regular/GovernanceExploit.js b/CI/exploits/regular/GovernanceExploit.js index 57ab0cf..3b691ae 100644 --- a/CI/exploits/regular/GovernanceExploit.js +++ b/CI/exploits/regular/GovernanceExploit.js @@ -79,7 +79,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -104,7 +104,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-1.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-1.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-1.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-1.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-10.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-10.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-10.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-10.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-11.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-11.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-11.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-11.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-12.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-12.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-12.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-12.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-13.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-13.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-13.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-13.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-14.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-14.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-14.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-14.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-15.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-15.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-15.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-15.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-16.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-16.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-16.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-16.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-17.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-17.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-17.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-17.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-18.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-18.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-18.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-18.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-19.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-19.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-19.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-19.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-2.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-2.js index 817403c..9ced2fa 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-2.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-2.js @@ -72,7 +72,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -97,7 +97,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-20.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-20.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-20.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-20.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-21.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-21.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-21.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-21.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-22.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-22.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-22.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-22.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-23.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-23.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-23.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-23.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-24.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-24.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-24.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-24.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-25.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-25.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-25.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-25.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-3.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-3.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-3.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-3.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-4.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-4.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-4.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-4.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-5.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-5.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-5.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-5.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-6.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-6.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-6.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-6.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-7.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-7.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-7.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-7.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-8.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-8.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-8.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-8.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-9.js b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-9.js index 1c870c9..8e86b56 100644 --- a/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-9.js +++ b/CI/exploits/synthesized-exploit-diversification/GovernanceExploit-9.js @@ -75,7 +75,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -101,7 +101,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-1.js b/CI/exploits/synthesized/GovernanceExploit-1.js index 44090be..eb2678f 100644 --- a/CI/exploits/synthesized/GovernanceExploit-1.js +++ b/CI/exploits/synthesized/GovernanceExploit-1.js @@ -78,7 +78,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -104,7 +104,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-10.js b/CI/exploits/synthesized/GovernanceExploit-10.js index e7c6bd8..aa8e169 100644 --- a/CI/exploits/synthesized/GovernanceExploit-10.js +++ b/CI/exploits/synthesized/GovernanceExploit-10.js @@ -105,7 +105,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-11.js b/CI/exploits/synthesized/GovernanceExploit-11.js index d0c623c..eaa8f7d 100644 --- a/CI/exploits/synthesized/GovernanceExploit-11.js +++ b/CI/exploits/synthesized/GovernanceExploit-11.js @@ -118,7 +118,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-12.js b/CI/exploits/synthesized/GovernanceExploit-12.js index e6f5e6d..e270883 100644 --- a/CI/exploits/synthesized/GovernanceExploit-12.js +++ b/CI/exploits/synthesized/GovernanceExploit-12.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-13.js b/CI/exploits/synthesized/GovernanceExploit-13.js index c28400f..9024c4f 100644 --- a/CI/exploits/synthesized/GovernanceExploit-13.js +++ b/CI/exploits/synthesized/GovernanceExploit-13.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-14.js b/CI/exploits/synthesized/GovernanceExploit-14.js index f07a80a..fab41e1 100644 --- a/CI/exploits/synthesized/GovernanceExploit-14.js +++ b/CI/exploits/synthesized/GovernanceExploit-14.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-15.js b/CI/exploits/synthesized/GovernanceExploit-15.js index 85633d2..803c94e 100644 --- a/CI/exploits/synthesized/GovernanceExploit-15.js +++ b/CI/exploits/synthesized/GovernanceExploit-15.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-16.js b/CI/exploits/synthesized/GovernanceExploit-16.js index 794f906..ed5b5a4 100644 --- a/CI/exploits/synthesized/GovernanceExploit-16.js +++ b/CI/exploits/synthesized/GovernanceExploit-16.js @@ -98,7 +98,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-17.js b/CI/exploits/synthesized/GovernanceExploit-17.js index f4da9b2..d05b8f1 100644 --- a/CI/exploits/synthesized/GovernanceExploit-17.js +++ b/CI/exploits/synthesized/GovernanceExploit-17.js @@ -95,7 +95,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-18.js b/CI/exploits/synthesized/GovernanceExploit-18.js index e2713b3..06a5000 100644 --- a/CI/exploits/synthesized/GovernanceExploit-18.js +++ b/CI/exploits/synthesized/GovernanceExploit-18.js @@ -84,7 +84,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-19.js b/CI/exploits/synthesized/GovernanceExploit-19.js index dd8d18d..4f00219 100644 --- a/CI/exploits/synthesized/GovernanceExploit-19.js +++ b/CI/exploits/synthesized/GovernanceExploit-19.js @@ -99,7 +99,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-2.js b/CI/exploits/synthesized/GovernanceExploit-2.js index 2e4438c..6861000 100644 --- a/CI/exploits/synthesized/GovernanceExploit-2.js +++ b/CI/exploits/synthesized/GovernanceExploit-2.js @@ -76,7 +76,7 @@ async function exploit(web3, envInfo, contractAddress) { from: envInfo.accounts[0], gas: 3000000 }); - governanceExploitLogger.info(`I am successful!`) + return true; } catch (error) { console.error("Error in governance actions:", error); @@ -108,7 +108,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-20.js b/CI/exploits/synthesized/GovernanceExploit-20.js index 264e6f1..6a527cb 100644 --- a/CI/exploits/synthesized/GovernanceExploit-20.js +++ b/CI/exploits/synthesized/GovernanceExploit-20.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-21.js b/CI/exploits/synthesized/GovernanceExploit-21.js index 1aeb72d..760ea2a 100644 --- a/CI/exploits/synthesized/GovernanceExploit-21.js +++ b/CI/exploits/synthesized/GovernanceExploit-21.js @@ -105,7 +105,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-22.js b/CI/exploits/synthesized/GovernanceExploit-22.js index dce45e4..1419da0 100644 --- a/CI/exploits/synthesized/GovernanceExploit-22.js +++ b/CI/exploits/synthesized/GovernanceExploit-22.js @@ -99,7 +99,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-23.js b/CI/exploits/synthesized/GovernanceExploit-23.js index 27c3f3b..1985235 100644 --- a/CI/exploits/synthesized/GovernanceExploit-23.js +++ b/CI/exploits/synthesized/GovernanceExploit-23.js @@ -103,7 +103,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-24.js b/CI/exploits/synthesized/GovernanceExploit-24.js index 449e3ab..b9bbafb 100644 --- a/CI/exploits/synthesized/GovernanceExploit-24.js +++ b/CI/exploits/synthesized/GovernanceExploit-24.js @@ -99,7 +99,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-25.js b/CI/exploits/synthesized/GovernanceExploit-25.js index 057e870..b0c79f1 100644 --- a/CI/exploits/synthesized/GovernanceExploit-25.js +++ b/CI/exploits/synthesized/GovernanceExploit-25.js @@ -89,7 +89,7 @@ async function exploit(web3, envInfo, contractAddress) { */ module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil - console.log(`contractAddress: ${contractAddress}`) + web3 = await createLoggerWeb3(web3); // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); diff --git a/CI/exploits/synthesized/GovernanceExploit-3.js b/CI/exploits/synthesized/GovernanceExploit-3.js index 515a4c4..a3b80c5 100644 --- a/CI/exploits/synthesized/GovernanceExploit-3.js +++ b/CI/exploits/synthesized/GovernanceExploit-3.js @@ -91,7 +91,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-4.js b/CI/exploits/synthesized/GovernanceExploit-4.js index 1fc6fe7..b4f7638 100644 --- a/CI/exploits/synthesized/GovernanceExploit-4.js +++ b/CI/exploits/synthesized/GovernanceExploit-4.js @@ -109,7 +109,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-5.js b/CI/exploits/synthesized/GovernanceExploit-5.js index eeba79b..a665ee6 100644 --- a/CI/exploits/synthesized/GovernanceExploit-5.js +++ b/CI/exploits/synthesized/GovernanceExploit-5.js @@ -108,7 +108,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-6.js b/CI/exploits/synthesized/GovernanceExploit-6.js index 841025a..c64bf91 100644 --- a/CI/exploits/synthesized/GovernanceExploit-6.js +++ b/CI/exploits/synthesized/GovernanceExploit-6.js @@ -99,7 +99,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-7.js b/CI/exploits/synthesized/GovernanceExploit-7.js index c7c8043..f45fcd1 100644 --- a/CI/exploits/synthesized/GovernanceExploit-7.js +++ b/CI/exploits/synthesized/GovernanceExploit-7.js @@ -102,7 +102,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-8.js b/CI/exploits/synthesized/GovernanceExploit-8.js index 5d7b9ac..17d4e0a 100644 --- a/CI/exploits/synthesized/GovernanceExploit-8.js +++ b/CI/exploits/synthesized/GovernanceExploit-8.js @@ -103,7 +103,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/exploits/synthesized/GovernanceExploit-9.js b/CI/exploits/synthesized/GovernanceExploit-9.js index c4a00bb..791336b 100644 --- a/CI/exploits/synthesized/GovernanceExploit-9.js +++ b/CI/exploits/synthesized/GovernanceExploit-9.js @@ -104,7 +104,7 @@ async function exploit(web3, envInfo, contractAddress) { module.exports = async function runTests(web3, envInfo, contractAddress) { // envInfo.accounts, envInfo.privateKeys, and envInfo.rpcAddress should be available from Anvil web3 = await createLoggerWeb3(web3); - console.log(`contractAddress: ${contractAddress}`) + // Execute the exploit let result = await exploit(web3, envInfo, contractAddress); // See if exploit has yielded the predicted result (a very manual oracle!) diff --git a/CI/setup-synthesized-separate.js b/CI/setup-synthesized-separate.js index 8662bf3..7184b14 100644 --- a/CI/setup-synthesized-separate.js +++ b/CI/setup-synthesized-separate.js @@ -14,7 +14,8 @@ const { const { sleep } = require('@lib/os/process'); const getLogger = require('@lib/logging/logger').getLogger; -const setupSyncLoggerUnified = getLogger('setup-synthesized-unified'); +let setupSyncLoggerUnified = getLogger('setup-synthesized-unified'); + const yargs = require('yargs/yargs'); const path = require('path'); @@ -79,7 +80,7 @@ async function setupAndRunTests(configFilePath) { let fullContractFileName = contract.name + '-' + variantIndex.toString(); let fullTestName = contract.name + "Exploit" + '-' + variantIndex.toString() + '.js'; let testDirectory = '/exploits/synthesized'; - console.log(`tests are: ${contract.tests}`); + setupSyncLoggerUnified.info(`Exploits are: ${contract.tests}`); let testName = contract.tests[0]; setupSyncLoggerUnified.debug(chalk.white(`Successfully read test info: ${testName} for ${contract} from config. Full name of test is: ${fullTestName}`)); diff --git a/lib/dcr/exec.js b/lib/dcr/exec.js index e05af6a..f1e7302 100644 --- a/lib/dcr/exec.js +++ b/lib/dcr/exec.js @@ -66,20 +66,20 @@ class DCRExecutor { try { execLogger.debug(`nextEventAddress: ${nextEventAddress}`); let res = await reqInstance.post(nextEventAddress, requestBody); - execLogger.info(` Response data: ${JSON.stringify(res.data)}`); - execLogger.info(` Response status: ${res.status}`); - execLogger.info(` Response headers: ${JSON.stringify(res.headers)}`); + execLogger.debug(` Response data: ${JSON.stringify(res.data)}`); + execLogger.debug(` Response status: ${res.status}`); + execLogger.debug(` Response headers: ${JSON.stringify(res.headers)}`); return { name: activityId, time: usedTime, violation: false }; } catch (error) { // if (error.response && error.response.status === 400) { // // Handle the violation // return { name: activityId, time: new Date().toGMTString(), violation: true }; // } - execLogger.error(` Error response data: ${JSON.stringify(error.response.data)}`); - execLogger.error(` Error response status: ${error.response.status}`); - execLogger.error(` Error response headers: ${JSON.stringify(error.response.headers)}`); + execLogger.debug(` Error response data: ${JSON.stringify(error.response.data)}`); + execLogger.debug(` Error response status: ${error.response.status}`); + execLogger.debug(` Error response headers: ${JSON.stringify(error.response.headers)}`); return { name: activityId, time: usedTime, violation: true }; - throw error; // Rethrow the error to be handled by the caller + //throw error; } } diff --git a/lib/dcr/info.js b/lib/dcr/info.js index d142341..527779c 100644 --- a/lib/dcr/info.js +++ b/lib/dcr/info.js @@ -215,7 +215,7 @@ const getPendingActivities = (modelID, simID) => { }); const url = `https://repository.dcrgraphs.net/api/graphs/${modelID}/sims/${simID}/`; - console.log(`the url is ${url}`); + infoLogger.debug(`the url is ${url}`); return reqInstance.get(url) .then(response => { diff --git a/lib/logging/logger.js b/lib/logging/logger.js index 7bdbdc9..110b964 100644 --- a/lib/logging/logger.js +++ b/lib/logging/logger.js @@ -48,7 +48,8 @@ exports.getLogger = (moduleName) => { ), transports: [ new winston.transports.Console({ - level: 'debug', // Ensure all levels are logged to the console + //level: 'debug', // Ensure all levels are logged to the console + level: 'info', // Suppress all other types of logs in the console for now; format: winston.format.combine( winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), winston.format.printf(info => `${info.timestamp} [${info.level}]: ${colorize(info.level, info.message)}`) diff --git a/lib/logging/logger_.js b/lib/logging/logger_.js deleted file mode 100644 index c8a3395..0000000 --- a/lib/logging/logger_.js +++ /dev/null @@ -1,64 +0,0 @@ -const winston = require('winston'); -const path = require('path'); -const chalk = require('chalk'); // Import chalk - -const logLevels = { - error: 0, - warn: 1, - info: 2, - debug: 3 -}; - -// Define colors for different levels using chalk -const colorize = (level, message) => { - switch (level) { - case 'error': - return chalk.red(message); - case 'warn': - return chalk.yellow(message); - case 'info': - return chalk.green(message); - case 'debug': - return chalk.white(message); - default: - return message; // Default no coloring - } -}; - -const logFormat = winston.format.printf(({ level, message, timestamp }) => { - return `${timestamp} [${level}]: ${colorize(level, message)}`; -}); - -// Strip ANSI color codes for file output -const stripAnsi = winston.format(info => { - info.message = info.message.replace(/\x1B[[(?);]{0,2}(;?\d)*./g, ''); - return info; -}); - -const logger = winston.createLogger({ - levels: logLevels, - format: winston.format.combine( - winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), - logFormat - ), - transports: [ - new winston.transports.Console({ - level: 'debug', // Ensure all levels are logged to the console - format: winston.format.combine( - logFormat - ) - }), - new winston.transports.File({ - filename: path.join(__dirname, '../../logs', new Date().toISOString().split('T')[0], 'session-logs.log'), - format: winston.format.combine( - stripAnsi(), - logFormat - ), - maxsize: 50 * 1024 * 1024, // 50MB - maxFiles: 5, - tailable: true, - }) - ] -}); - -module.exports = logger; \ No newline at end of file diff --git a/lib/monitor/translate.js b/lib/monitor/translate.js index fc203e8..fe467aa 100644 --- a/lib/monitor/translate.js +++ b/lib/monitor/translate.js @@ -14,7 +14,7 @@ class DCRTranslator { getDCRFromTX(tx, activities) { const signature = tx.input.slice(0, 10); const method = this.contractABI.find((m) => m.type === 'function' && `0x${this.web3.utils.keccak256(m.name + '(' + m.inputs.map((i) => i.type).join(',') + ')').slice(2, 10)}` === signature); - transLogger.info(`our method is: ${method}`); + transLogger.debug(`our method is: ${method}`); if (!method) return null; transLogger.debug(`Translating and finding this method: ${method.name}`); @@ -24,8 +24,8 @@ class DCRTranslator { if (decodedParams.__length__ > 0) { for (const [key, value] of Object.entries(decodedParams)) { - console.log(chalk.cyan(`key: ${key}, value: ${value}`)); - console.log(chalk.green(`this.modelFunctionParams: ${this.modelFunctionParams}`)) + transLogger.debug(chalk.cyan(`key: ${key}, value: ${value}`)); + transLogger.debug(chalk.green(`this.modelFunctionParams: ${this.modelFunctionParams}`)) if (key.match(/^\d+$/)) continue; if (this.modelFunctionParams) { const modelFunctionParam = this.modelFunctionParams[method.name] && this.modelFunctionParams[method.name][key]; diff --git a/lib/web3/deploy.js b/lib/web3/deploy.js index 66c12db..eeafba1 100644 --- a/lib/web3/deploy.js +++ b/lib/web3/deploy.js @@ -191,7 +191,7 @@ async function deployContract(web3, abi, bytecode, envInfo, constructorParameter */ let getContractABI = async (contractSource, contractFileName, contractIdentifier) => { try { - console.log(chalk.blue(`\ncontractFileName: ${contractFileName}, \ncontractIdentifier: ${contractIdentifier}`)) + compileWithVersionLogger.debug(chalk.blue(`\ncontractFileName: ${contractFileName}, \ncontractIdentifier: ${contractIdentifier}`)) // Extract the Solidity compiler version from the source code const solcVersion = extractSolcVersion(contractSource); diff --git a/monitor/monitor.js b/monitor/monitor.js index 37ce409..708fb48 100644 --- a/monitor/monitor.js +++ b/monitor/monitor.js @@ -90,9 +90,9 @@ class Monitor extends EventEmitter { async handleContractEvent(tx) { let violates = false; // Process the transaction and translate it into DCR activities - console.log(chalk.cyan(`config activities are: ${this.configs.activities}`)) + monitorLogger.debug(chalk.cyan(`config activities are: ${this.configs.activities}`)) const dcrActivities = this.dcrTranslator.getDCRFromTX(tx, this.configs.activities); - monitorLogger.info(`dcrActivities: ${dcrActivities}`); + monitorLogger.debug(`dcrActivities: ${dcrActivities}`); if (dcrActivities) { const promises = dcrActivities.map(async activity => { if (this.hasResponse) { diff --git a/monitor/multi-chain-monitor.js b/monitor/multi-chain-monitor.js index 19bf574..a774cb2 100644 --- a/monitor/multi-chain-monitor.js +++ b/monitor/multi-chain-monitor.js @@ -133,7 +133,7 @@ class Monitor extends EventEmitter { async handleContractEvent(tx, source) { let violates = false; // Process the transaction and translate it into DCR activities - console.log(chalk.cyan(`config activities are: ${this.configs.activities}`)); + monitorLogger.debug(chalk.cyan(`config activities are: ${this.configs.activities}`)); let dcrActivities; if (source == 'A') { dcrActivities = this.dcrTranslatorA.getDCRFromTX(tx, this.configs.activities); @@ -143,7 +143,7 @@ class Monitor extends EventEmitter { throw new Error("The source in multi-chain monitor is not recognizable"); } - monitorLogger.info(`dcrActivities: ${dcrActivities}`); + monitorLogger.debug(`dcrActivities: ${dcrActivities}`); if (dcrActivities) { const promises = dcrActivities.map(async activity => { if (this.hasResponse) { diff --git a/results/Governance-1.md b/results/Governance-1.md index 8edcc37..1ac8b60 100644 --- a/results/Governance-1.md +++ b/results/Governance-1.md @@ -1,8 +1,8 @@ | Activity ID | Time | Violation | Simulation | | --- | --- | --- | --- | -| createProposal | 2024-06-23T11:58:02.932Z | false | 2015438 | -| vote | 2024-06-23T11:58:13.024Z | true | 2015438 | -| vote | 2024-06-23T11:58:13.534Z | false | 2015438 | -| vote | 2024-06-23T11:58:14.037Z | false | 2015438 | -| vote | 2024-06-23T11:58:14.559Z | false | 2015438 | -| executeProposal | 2024-06-23T11:58:25.052Z | false | 2015438 | \ No newline at end of file +| createProposal | 2024-06-24T08:43:47.619Z | false | 2015457 | +| vote | 2024-06-24T08:43:57.717Z | true | 2015457 | +| vote | 2024-06-24T08:43:58.255Z | false | 2015457 | +| vote | 2024-06-24T08:43:58.732Z | false | 2015457 | +| vote | 2024-06-24T08:43:59.234Z | false | 2015457 | +| executeProposal | 2024-06-24T08:44:09.763Z | false | 2015457 | \ No newline at end of file diff --git a/results/json/successful_exploits.json b/results/json/successful_exploits.json index a2f3cf1..2ba05b0 100644 --- a/results/json/successful_exploits.json +++ b/results/json/successful_exploits.json @@ -24,6 +24,26 @@ "exploit": "GovernanceExploit", "result": true }, + { + "contract": "Governance-1", + "exploit": "GovernanceExploit", + "result": true + }, + { + "contract": "Governance-1", + "exploit": "GovernanceExploit", + "result": true + }, + { + "contract": "Governance-1", + "exploit": "GovernanceExploit", + "result": true + }, + { + "contract": "Governance-1", + "exploit": "GovernanceExploit", + "result": true + }, { "contract": "Governance-1", "exploit": "GovernanceExploit",