Credential.sol and Credential1155.sol are smart contracts designed to allow users to register credentials. The contracts use OpenZeppelin open source contracts, such as AccessControl, ECDSA, and EIP712.
The main features of these contracts are:
- The Issuer address specified in the constructor is a privileged signing address.
- Once a credential is registered, the subject address is minted an ERC721 or ERC1155 token.
- Users can check if a subject has a registered credential by calling
checkRegistration()
. - Credential.sol and Credential1155.sol use Access Control and ECDSA signature checking to ensure that a credential is signed by the specified issuer.
Credential.sol and Credential1155.sol use Access Control and ECDSA signature checking to ensure that a credential is signed by the issuer that was specified in the constructor
To install dependencies
run :
yarn
To test the contracts
run :
yarn test
To start a hardhat node run :
yarn network
To deploy the Credential contracts run :
yarn deploy
Or
yarn deploy1155
Copy the deployment address into the sign and register scripts
To sign the 712 data run :
yarn sign
Or
yarn sign1155
Copy the signature data into the register script
to register the Credential run :
yarn register
Or
yarn register1155