Comment on page
🏷
Labels widget
Trustblock labels are visual gateways to display the security state of a project on a website.
- 1.Import the script to your website entry HTML file, as follows:
<script src="https://widget.trustblock.run/audit-label.js" defer />
- 2.Start adding labels anywhere you want on your website:
<div
data-tb-audit-label
data-tb-contractaddress="0xabcde..."
data-tb-chainid="1"
/>
Each label div must have the
data-tb-audit-label
attribute.
Then depending on your use case, It must have either data-tb-auditid
or data-tb-contractaddress
along with data-tb-chainid
.If you already know the project you want to display the label for and are not in a dynamic context, then you should use
data-tb-auditid
. - 1.Head to the project's audit on Trustblock's app, go to the corresponding audit, and get the id from the URL. Eg.
https://beta.trustblock.run/audit/7b9a2b01-bb84-42ca-ac0e-8b70c86debe3
, here7b9a2b01-bb84-42ca-ac0e-8b70c86debe3
is the audit id. - 2.Then declare your div as follows:
<div
data-tb-audit-label
data-tb-auditid="7b9a2b01-bb84-42ca-ac0e-8b70c86debe3"
/>
If you don't know the project you want to display the label for and are in a dynamic context, then you should use
data-tb-contractaddress
along with data-tb-chainid
.- 1.Declare your div as follows:
<div
data-tb-audit-label
data-tb-contractaddress="0xabdcde"
data-tb-chainid="1"
/>
data-tb-contractaddress
: is the address of the contract.data-tb-chainid
: is the chain id of the contract. Below is the list of possible values fordata-tb-chainid
:1
: Ethereum137
: Polygon43113
: Avalanche56
: Bnb Chain
Optionally, you can add the following attributes with hexadecimal color values to customize the render:
data-tb-colortext
data-tb-colorbackground
data-tb-colorborder
data-tb-mode
data-tb-size
Now it's showing "Not audited" because the filter was set to an address that has not upvoted the auditor who audited this contract.