Skip to content

Instantly share code, notes, and snippets.

@jangyoungdo
Last active May 27, 2021 06:04
Show Gist options
  • Save jangyoungdo/177df3289dd13c5582df3801c23d4b44 to your computer and use it in GitHub Desktop.
Save jangyoungdo/177df3289dd13c5582df3801c23d4b44 to your computer and use it in GitHub Desktop.
2주차 .sol
//배포한 주소 0xb97a7c411b126e72af2ca972580e238e56c0c0d5
//pragma solidity >=0.4.24 <=0.5.6;
pragma experimental ABIEncoderV2;
contract EnrollmentMusic {
struct Music {
string _MusicName;
string _informationOfMusic;
string _mp3_file;
}
address _myaddress;
mapping (string => mapping (address => Music[])) public My_music_is;
modifier onlyCreater {
require(msg.sender == _myaddress,"Can't use this service");
_;
}
function I_am_Creater() public {
_myaddress = msg.sender;
}
function pushMusic( string memory _myName,
address _myaddress,
string memory _MusicName,
string memory _informationOfMusic,
string memory _mp3_file//string memory _mp3_file =>임시적으로 표현, 어떻게 구현할 지 연구중
) public onlyCreater returns(bool) {
My_music_is[_myName][_myaddress].push(Music(_MusicName,_informationOfMusic,_mp3_file));
return true;
}
function checkMyMusic(string memory _myName,
address _myaddress) public onlyCreater returns(Music[]memory){
return My_music_is[_myName][_myaddress];
}
}
@Sunggil
Copy link

Sunggil commented May 27, 2021

안녕하세요 직접 제작한 음악을 NFT로 등록, 마켓에서 거래가 가능한 앱을 개발 중이시군요

소스코드를 살펴보다 보니 가이드에 어긋나는 표현식들이 보여서 링크를 하나 드립니다. 한국어로 변역이 되어 있어서 보시는데는 불편함은 없으실겁니다.

솔리디티 스타일 가이드

명명 규칙

@jangyoungdo
Copy link
Author

안녕하세요 직접 제작한 음악을 NFT로 등록, 마켓에서 거래가 가능한 앱을 개발 중이시군요

소스코드를 살펴보다 보니 가이드에 어긋나는 표현식들이 보여서 링크를 하나 드립니다. 한국어로 변역이 되어 있어서 보시는데는 불편함은 없으실겁니다.

솔리디티 스타일 가이드

명명 규칙

오 감사합니다. 아직 많이 부족하니 조언 아끼지 말아주세요. 정말 감사합니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment