Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • core-perl6 core-perl6
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pheix-poolpheix-pool
  • core-perl6core-perl6
  • Issues
  • #156
Closed
Open
Issue created Jan 06, 2022 by Konstantin Narkhov@pheixOwner

Add catch contract feature

Add catch contract feature. It depends on auth smart contract update with ability to emit event in constructor;

To filter all authentificator smart contracts:

var CurrFilterRes; web3.eth.filter({fromBlock: 0, toBlock: 'latest', topics: [web3.sha3('PheixAuthCode(uint256)'),"0x" + web3.padLeft('1',64)]}).get(function(error, result){ if (!error) CurrFilterRes = result; else console.log(error); });

The CurrFilterRes will contain array with smart contract details (address is smart contract deployment addr, get the latest with CurrFilterRes[CurrFilterRes.length - 1]):

[{
    address: "0x78d8183710ecbb204e2f0220d24110d97cd36ea8",
    blockHash: "0x0860e9cd3638bbfb478bfc8b3b2938021d1d2ca1eecf8c2db1afb0c5be8f5591",
    blockNumber: 25,
    data: "0x",
    logIndex: 0,
    removed: false,
    topics: ["0x1afba253d16484eec92f8931ecedf989ad94e32e0a097a8b37c174c1c86524d4", "0x0000000000000000000000000000000000000000000000000000000000000001"],
    transactionHash: "0xd9d60c2379892dcad6a937ed34b1dc2544a56c98d93130dc9260f4c3b5937329",
    transactionIndex: 0
}, {
    address: "0x92f2d25504ef38ee3c9cdabde6e309a061c67e20",
    blockHash: "0x3ce94da169a7761c5a98a5307f621bd826a658057f13926f9ca076c35655db7a",
    blockNumber: 468,
    data: "0x",
    logIndex: 0,
    removed: false,
    topics: ["0x1afba253d16484eec92f8931ecedf989ad94e32e0a097a8b37c174c1c86524d4", "0x0000000000000000000000000000000000000000000000000000000000000001"],
    transactionHash: "0x091f999c716296c5ae28cfbf15cb5e96fae12003b0b88bc05c405ffea9ff6199",
    transactionIndex: 0
}]

The catch contract feature just should:

  • Get latest deployed smart contract
  • Get latest updateState() transaction for this smart contract (CurrFilterRes[CurrFilterRes.length - 1]):
var CurrFilterRes; web3.eth.filter({fromBlock: 468, toBlock: 'latest', address: '0x92f2d25504ef38ee3c9cdabde6e309a061c67e20', topics: [web3.sha3('PheixAuthCode(uint256)'),"0x" + web3.padLeft('2',64)]}).get(function(error, result){ if (!error) CurrFilterRes = result; else console.log(error); });
  • Try to validate session with validate_on_blockchain() use the transaction hash from previous step.
Edited Jan 06, 2022 by Konstantin Narkhov
Assignee
Assign to
Time tracking