Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createUser(
- address _address,
- string memory _name,
- string memory _companyName,
- int _numYearsExperience,
- int _pricePerHour,
- string memory _specialisation,
- string memory _summary,
- int _numAdsViewed,
- int _numAdsPurchased
- ) public
- {
- address _userAddress = _address;
- // Storage for list of users
- User storage user = users[_userAddress];
- // Check that the user did not already exist
- require(
- !user.set,
- "User already exists!"
- );
- //Store the user
- users[_userAddress] = User({
- name: _name,
- companyName: _companyName,
- numYearsExperience: _numYearsExperience,
- pricePerHour: _pricePerHour,
- specialisation: _specialisation,
- summary: _summary,
- set: true,
- numAdsViewed: _numAdsViewed,
- numAdsPurchased: _numAdsPurchased
- });
- }
- var info = data[i]
- var name = String(info.name)
- var companyName = String(info.companyName)
- var pricePerHour = parseInt(info.pricePerHour);
- var yearsExperience = parseInt(info.yearsExperience);
- var specialisation = String(info.specialisation)
- var summary = String(info.summary)
- var address = info.address;
- var maxCPT = parseInt(info.maxCPT);
- await sellContract.methods.createUser(address, name, companyName, yearsExperience, pricePerHour, specialisation, summary, 0, 0).send({ from: accounts[0]})
Add Comment
Please, Sign In to add comment