Skip to content

Instantly share code, notes, and snippets.

@jsaur
jsaur / CreditRegistry.sol
Last active October 22, 2019 13:35
This is a simple version of the credit registry. You can test it in http://remix.ethereum.org.
pragma solidity ^0.5.11;
/*
* Note that Solidity can't return an array of strings :(
* https://solidity.readthedocs.io/en/v0.4.21/frequently-asked-questions.html#is-it-possible-to-return-an-array-of-strings-string-from-a-solidity-function
* So rather than allow arbitrary lengthed strings for DIDs and hashes we use a fixed size bytes32. This is the largest native bype size in solidity
* so if we find that we need more, we will have to come up with another solution.
* Another option if we wanted to support strings would be to use ABIEncoderV2, however if we can guaruntee fixed lengths it will be more performant
*/
contract CreditRegistry {
pragma solidity >=0.5.0 <0.7.0;
// In remix you can import from github
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/GSN/GSNRecipient.sol";
// I think in other deployments you'll need to import this way
// import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";
contract CashPoints is GSNRecipient {
uint public Count;