
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
poh-tron-react
Advanced tools
Proof-of-Humanity TRON Core Component for React.
Used as a wrapper for PoH validators.
https://poh-tron-counter.bakoush.in (source code)
npm install poh-tron-react
ProofOfHumanityProvider
import { ProofOfHumanityProvider } from "poh-tron-react";
<ProofOfHumanityProvider>
<App />
</ProofOfHumanityProvider>;
import hCaptchaValidator from "poh-validator-hcaptcha";
const validator = (
<HCaptchaValidator
sitekey="10000000-ffff-ffff-ffff-000000000001"
url="http://localhost:3000/api/v1/proof"
/>
);
getProofOfHumanity
method from the PoH hookimport { useProofOfHumanity } from "poh-tron-react";
const { getProofOfHumanity } = useProofOfHumanity(validator);
const handleClick = () => {
try {
const { error, errorMessage, proof } = await getProofOfHumanity();
if (!error) {
await mySmartContract.someImportantMethod(proof).send({
feeLimit: 100_000_000,
callValue: 0
});
}
} catch(error) {
console.error(error);
}
}
<button onClick={handleClick}>Send transaction</button>
The method in the smart contract must know how to deal with the
proof
. You can leverage a Solidity library just for that: poh-tron-contracts
If you want to use sovereign PoH instead of the basic one, you have to provide additional options
object to useProofOfHumanity
hook.
Options
object has two properties:
type
– if sovereign
, the PoH component should ask the user to confirm their address ownership. The default value is basic
tronWeb
– specifies TronWeb API used to sign address ownership confirmationExample:
import { useProofOfHumanity } from "poh-tron-react";
const { getProofOfHumanity } = useProofOfHumanity(validator, {
type: "sovereign",
tronWeb,
});
Validator plugin component must be a React component accepting the following props:
renderLogoOnly
(boolean) – if true
, the component should render its own logo instead of actual validator interface
data
(string) – data (a hex string) to be included into signed proof-of-humanity. Can be a random hex challege, or a random hex challenge along with address owner signature
onVerify
(function) – must be called once validation is complete with the object with following keys as the only parameter:
error
(boolean) – true
in case of error; otherwise false
errorMessage
(string) – in case of error; otherwise null
proof
(string): proof-of-humanity (a hex string); null
in case of error
Example plugin: hCaptcha validator
Alex Bakoushin
MIT
FAQs
Proof-of-Humanity TRON Core React Component
We found that poh-tron-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.