This repository contains smart contracts for the reference implementation of the OpenVASP standard
You can use smart contract Vasp Facade (0xb838ef6121b8093f425fdc336d59e1142c2e289) to create new instance of CASP smart contract.
After call method build you can see in transaction event VaspCreated where in first parameter you can see newVaspAddress.
The address that broadcast transaction with build is automatically set as the owner and administrator.
- open page https://ropsten.etherscan.io/address/0xb838ef6121b8093f425fdc336d59e1142c2e289c#writeContract
- call metod
buildand fill 5 params - check event
VaspCreatedin transaction
- Execute
npm install -g truffleto install Truffle - Create
.envfile. Specify (see.env.template):
PRIVATE_KEYprivate key for broadcast deployment transaction.ROPSTEN_NODE_URLjson rpc node url for Ropsten network.ETHEREUM_NODE_URLjson rpc node url for Ethereum network.ETHERSCAN_API_KEYAPI key from Etherscan account in a case to verify smart contract on Etherscan
- Execite
npm installto install dependencies - Run local ganache node to test smart contract:
ganache-cli. - Execite
truffle compileto compile smart contracts - Execite
truffle testto run tests - Execite
truffle migrateto deploy smart contract into local ganache node - Execite
truffle migrate --network ropstento deploy smart contract into Ropsten network - Execite
truffle migrate --network ethereumto deploy smart contract into Ethereum network - Verify smart contract on Etherscan
- Execite
truffle run verify VASP --network ropsten - Execite
truffle run verify VaspFactory --network ropsten
Execute npm run test command.
- Create
.envfile. SpecifyROPSTEN_PRIVATE_KEYandROPSTEN_NODE_URLwith correct values in it (see.env.template). - Execute
npx oz create VASP --network ropsten - Agree to initialize the instance after creating it
- Choose
initialize(owner: address, initialAdministrators: address[])option - Provide an owner's address
- Provide administrators' addresses
- Specify administrator's private key in the
.envfile - Execute
npx oz send-tx <VASP instance address> --method setPostalAddress --args "address line", "post code", "town", "country" --network ropstento set postal address. - Execute
npx oz send-tx <VASP instance address> --method setName --args "VASP name" --network ropstento set VASP name. - Execute
npx oz send-tx <VASP instance address> --method setEmail --args "VASP e-mail" --network ropstento set VASP e-mail. - Execute
npx oz send-tx <VASP instance address> --method setWebsite --args "VASP website url" --network ropstento set VASP website url. - Preserve
./openzeppelin/ropsten.jsonfile for future use.
In some smart contracts you can find a ______gap variable.
Since OpenZeppelin contracts are used by inheritance, user-defined variables will be placed by the compiler after OpenZeppelin’s ones. If, in a newer version, new variables are added by the library, the storage layouts would be incompatible, and an upgrade would not be possible.
The gap is a workaround to that issue: by leaving a 50-slot gap, we’re able to increase the contract’s storage by that amount (provided we also remove the same slots from the gap) with no clashing issues.
