Skip to content

Commit 8ddac12

Browse files
committed
Update solidity version in contracts
1 parent 2d7be8e commit 8ddac12

8 files changed

+2526
-3005
lines changed

contracts/Migrations.sol

-23
This file was deleted.

contracts/Ownable.sol

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
pragma solidity ^0.5.0;
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.6.0;
24

35
/**
46
* @dev Contract module which provides a basic access control mechanism, where

contracts/PackageRegistry.sol

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
pragma solidity >=0.5.10;
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.6.0;
24

35
import {PackageRegistryInterface} from "./PackageRegistryInterface.sol";
46
import {Ownable} from "./Ownable.sol";
@@ -69,6 +71,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
6971
string memory manifestURI
7072
)
7173
public
74+
override
7275
onlyOwner
7376
returns (bytes32)
7477
{
@@ -140,6 +143,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
140143
/// @param packageId The package id to look up
141144
function getPackageName(bytes32 packageId)
142145
public
146+
override
143147
view
144148
returns (string memory packageName)
145149
{
@@ -153,6 +157,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
153157
/// @param limit The length of the slice
154158
function getAllPackageIds(uint offset, uint limit)
155159
public
160+
override
156161
view
157162
returns (
158163
bytes32[] memory packageIds,
@@ -194,6 +199,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
194199
/// @param limit The length of the slice
195200
function getAllReleaseIds(string memory packageName, uint offset, uint limit)
196201
public
202+
override
197203
view
198204
onlyIfPackageExists(packageName)
199205
returns (
@@ -239,6 +245,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
239245
/// @param releaseId Release id
240246
function getReleaseData(bytes32 releaseId)
241247
public
248+
override
242249
view
243250
returns (
244251
string memory packageName, string memory version,
@@ -255,6 +262,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
255262
/// @param version Version string(ex: '1.0.0')
256263
function getReleaseId(string memory packageName, string memory version)
257264
public
265+
override
258266
view
259267
onlyIfPackageExists(packageName)
260268
onlyIfReleaseExists(packageName, version)
@@ -264,7 +272,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
264272
}
265273

266274
/// @dev Returns the number of packages stored on the registry
267-
function numPackageIds() public view returns (uint totalCount)
275+
function numPackageIds() public override view returns (uint totalCount)
268276
{
269277
return packageCount;
270278
}
@@ -273,6 +281,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
273281
/// @param packageName Package name
274282
function numReleaseIds(string memory packageName)
275283
public
284+
override
276285
view
277286
onlyIfPackageExists(packageName)
278287
returns (uint totalCount)
@@ -327,6 +336,7 @@ contract PackageRegistry is PackageRegistryInterface, Ownable {
327336
string memory version
328337
)
329338
public
339+
override
330340
view
331341
returns (bytes32)
332342
{

contracts/PackageRegistryInterface.sol

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
pragma solidity >=0.5.10;
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.6.0;
24

35

46
/// @title EIP 1319 Smart Contract Package Registry Interface
57
/// @author Piper Merriam <[email protected]>, Christopher Gewecke <[email protected]>
6-
contract PackageRegistryInterface {
8+
abstract contract PackageRegistryInterface {
79

810
//
911
// +-------------+
@@ -22,6 +24,7 @@ contract PackageRegistryInterface {
2224
string memory manifestURI
2325
)
2426
public
27+
virtual
2528
returns (bytes32 releaseId);
2629

2730
//
@@ -34,6 +37,7 @@ contract PackageRegistryInterface {
3437
/// @param packageId The package id to look up
3538
function getPackageName(bytes32 packageId)
3639
public
40+
virtual
3741
view
3842
returns (string memory packageName);
3943

@@ -42,6 +46,7 @@ contract PackageRegistryInterface {
4246
/// @param limit The length of the slice
4347
function getAllPackageIds(uint offset, uint limit)
4448
public
49+
virtual
4550
view
4651
returns (
4752
bytes32[] memory packageIds,
@@ -54,6 +59,7 @@ contract PackageRegistryInterface {
5459
/// @param limit The length of the slice
5560
function getAllReleaseIds(string memory packageName, uint offset, uint limit)
5661
public
62+
virtual
5763
view
5864
returns (
5965
bytes32[] memory releaseIds,
@@ -64,6 +70,7 @@ contract PackageRegistryInterface {
6470
/// @param releaseId Release id
6571
function getReleaseData(bytes32 releaseId)
6672
public
73+
virtual
6774
view
6875
returns (
6976
string memory packageName,
@@ -76,6 +83,7 @@ contract PackageRegistryInterface {
7683
// @param version Version string (ex: '1.0.0')
7784
function generateReleaseId(string memory packageName, string memory version)
7885
public
86+
virtual
7987
view
8088
returns (bytes32 releaseId);
8189

@@ -84,13 +92,14 @@ contract PackageRegistryInterface {
8492
/// @param version Version string(ex: '1.0.0')
8593
function getReleaseId(string memory packageName, string memory version)
8694
public
95+
virtual
8796
view
8897
returns (bytes32 releaseId);
8998

9099
/// @dev Returns the number of packages stored on the registry
91-
function numPackageIds() public view returns (uint totalCount);
100+
function numPackageIds() public virtual view returns (uint totalCount);
92101

93102
/// @dev Returns the number of releases for a given package name on the registry
94103
/// @param packageName Package name
95-
function numReleaseIds(string memory packageName) public view returns (uint totalCount);
104+
function numReleaseIds(string memory packageName) public virtual view returns (uint totalCount);
96105
}

migrations/1_initial_migration.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const Migrations = artifacts.require("Migrations");
1+
const PackageRegistry = artifacts.require("PackageRegistry");
22

33
module.exports = function(deployer) {
4-
deployer.deploy(Migrations);
4+
deployer.deploy(PackageRegistry);
55
};

0 commit comments

Comments
 (0)