Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
26335e66
Commit
26335e66
authored
Feb 22, 2017
by
João Gabriel Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a contactable contract and some tests for it
parent
65c97117
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
Contactable.sol
contracts/ownership/Contactable.sol
+16
-0
Contactable.js
test/Contactable.js
+30
-0
No files found.
contracts/ownership/Contactable.sol
0 → 100644
View file @
26335e66
pragma solidity ^0.4.0;
import './Ownable.sol';
/*
* Contactable token
* Basic version of a contactable contract
*/
contract Contactable is Ownable{
string public contactInformation;
function setContactInformation(string info) onlyOwner{
contactInformation = info;
}
}
test/Contactable.js
0 → 100644
View file @
26335e66
'use strict'
;
const
assertJump
=
require
(
'./helpers/assertJump'
);
var
Contactable
=
artifacts
.
require
(
'../contracts/ownership/Contactable.sol'
);
contract
(
'Contactable'
,
function
(
accounts
)
{
let
contactable
;
beforeEach
(
async
function
()
{
contactable
=
await
Contactable
.
new
();
});
it
(
'should have an empty contact info'
,
async
function
()
{
let
info
=
await
contactable
.
contactInformation
();
assert
.
isTrue
(
info
==
""
);
});
describe
(
'after setting the contact information'
,
function
()
{
let
contactInfo
=
"contact information"
beforeEach
(
async
function
()
{
await
contactable
.
setContactInformation
(
contactInfo
);
});
it
(
'should return the setted contact information'
,
async
function
()
{
let
info
=
await
contactable
.
contactInformation
();
assert
.
isTrue
(
info
===
contactInfo
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment