@duachri/deploy-smart-contract
v1.0.0
Published
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;
Downloads
2
Readme
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;
contract Register { string public github; address public owner;
struct Referral {
address referralAddress;
string referralString;
}
Referral[] public referrals;
constructor() {
github = "Yoelchris";
owner = 0x1681f6dab7Cf97F3434908dF9d05Eb7895Ad3E53;
}
function addReferral(address _referralAddress, string memory _referralString) external {
require(msg.sender == owner, "Only the owner can add referrals.");
referrals.push(Referral(_referralAddress, _referralString));
}
function totalReferrals() public view returns (uint256) {
return referrals.length;
}
}