メインコンテンツまでスキップ

v2

v2 contracts are running on Arbitrum and Polygon.

v2 address information

How to use

First, install this repository as an npm package.

Install

> npm i -D @devprotocol/protocol-v2

Import

You can use the Dev Protocol interface by importing it from a Solidity file.

import {IAddressRegistry} from "@devprotocol/protocol-v2/contracts/interface/IAddressRegistry.sol";
import {IPropertyFactory} from "@devprotocol/protocol-v2/contracts/interface/IPropertyFactory.sol";

contract TestContract {
/**
* @dev validates property address.
* @param _property Property address for validation check
* Network: Mumbai Testnet
* Address: 0xe2C16936413D74c667aeF0D040c920BF639067d4
*/
function validatePropertyAddress(address _property) external view {
IAddressRegistry registry = IAddressRegistry(0xe2C16936413D74c667aeF0D040c920BF639067d4);
IPropertyFactory propertyFactory = IPropertyFactory(registry.registries("PropertyFactory"));
require(propertyFactory.isProperty(_property), "not property address");
}
}
Open in Remix

This is an example of logic that uses the PropertyFactory contract feature of the Dev Protocol to validate if it is a Property address.

The available interfaces can be found in "node_modules/@devprotocol/protocol-v2/contracts/interface/".

AddressRegistry holds the addresses of the contracts used in the Dev Protocol.

AddressRegistry address
arbitrum mainet:0x0a15Ccf5E6029AaAeBc5F01b09d3C240Dc56c5f9
arbitrum rinkeby:0xE75929F46355ad8C5C558755D836364f119BdB22